@launchdarkly/mcp-server
Version:
The local [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for [LaunchDarkly](https://launchdarkly.com/) federal and European Union (EU) environments.
39 lines (32 loc) • 1.18 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import { environmentsListByProject } from "../../funcs/environmentsListByProject.js";
import * as operations from "../../models/operations/index.js";
import { formatResult, ToolDefinition } from "../tools.js";
const args = {
request: operations.GetEnvironmentsByProjectRequest$inboundSchema,
};
export const tool$environmentsListByProject: ToolDefinition<typeof args> = {
name: "get-environments",
description:
`Identifies which environments exist in a project and determines which are marked as "critical" (production, staging, etc.). Allows agents to programmatically identify critical environments instead of hardcoding assumptions.
`,
scopes: ["read"],
args,
tool: async (client, args, ctx) => {
const [result, apiCall] = await environmentsListByProject(
client,
args.request,
{ fetchOptions: { signal: ctx.signal } },
).$inspect();
if (!result.ok) {
return {
content: [{ type: "text", text: result.error.message }],
isError: true,
};
}
const value = result.value;
return formatResult(value, apiCall);
},
};