get_account
Retrieve detailed account information from Octopus Deploy by providing the space name and account ID. Use this tool to access account data for DevOps management and troubleshooting.
Instructions
Get details for a specific account by its ID
This tool retrieves detailed information about a specific account using its ID. The space name and account ID are both required.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spaceName | Yes | ||
| accountId | Yes | The ID of the account to retrieve |
Implementation Reference
- src/tools/getAccount.ts:25-48 (handler)The core handler function for the 'get_account' tool. It fetches the Octopus Deploy client configuration, resolves the space ID, retrieves the account resource via API, maps it to a simplified structure, and returns it as JSON-formatted text content.async ({ spaceName, accountId }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const response = await client.get<AccountResource>( "~/api/{spaceId}/accounts/{id}", { spaceId, id: accountId, } ); const account = mapAccountResource(response); return { content: [ { type: "text", text: JSON.stringify(account), }, ], }; }
- src/tools/getAccount.ts:17-20 (schema)Input schema using Zod validation for the tool parameters: spaceName (string) and accountId (string with description).{ spaceName: z.string(), accountId: z.string().describe("The ID of the account to retrieve"), },
- src/tools/getAccount.ts:12-50 (registration)Primary registration of the 'get_account' tool on the MCP server within the registerGetAccountTool function, including name, description, input schema, output metadata, and handler reference.server.tool( "get_account", `Get details for a specific account by its ID This tool retrieves detailed information about a specific account using its ID. The space name and account ID are both required.`, { spaceName: z.string(), accountId: z.string().describe("The ID of the account to retrieve"), }, { title: "Get a specific account by ID from an Octopus Deploy space", readOnlyHint: true, }, async ({ spaceName, accountId }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const response = await client.get<AccountResource>( "~/api/{spaceId}/accounts/{id}", { spaceId, id: accountId, } ); const account = mapAccountResource(response); return { content: [ { type: "text", text: JSON.stringify(account), }, ], }; } ); }
- src/tools/getAccount.ts:52-56 (registration)Self-registration of the get_account tool into the central TOOL_REGISTRY, specifying toolset and read-only config for conditional enabling in index.ts.registerToolDefinition({ toolName: "get_account", config: { toolset: "accounts", readOnly: true }, registerFn: registerGetAccountTool, });