Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

list_accounts

Retrieve all accounts within a specified Octopus Deploy space, with optional filtering by name, account type, or other parameters to manage access credentials.

Instructions

List accounts in a space

This tool lists all accounts in a given space. The space name is required. You can optionally filter by various parameters like name, account type, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountTypeNo
idsNo
partialNameNo
skipNo
spaceNameYes
takeNo

Implementation Reference

  • The main handler function for the 'list_accounts' tool. It creates an Octopus Deploy client, resolves the space ID, queries the accounts API endpoint with optional filters, maps the account resources, and returns a structured JSON response.
    async ({ spaceName, skip, take, ids, partialName, accountType, }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const response = await client.get<ResourceCollection<AccountResource>>( "~/api/{spaceId}/accounts{?skip,take,ids,partialName,accountType}", { spaceId, skip, take, ids, partialName, accountType, } ); const accounts = response.Items.map((account: AccountResource) => mapAccountResource(account)); return { content: [ { type: "text", text: JSON.stringify({ totalResults: response.TotalResults, itemsPerPage: response.ItemsPerPage, numberOfPages: response.NumberOfPages, lastPageNumber: response.LastPageNumber, items: accounts, }), }, ], }; }
  • Input schema defined using Zod for the tool parameters: spaceName (required), skip, take, ids, partialName, accountType (optional).
    { spaceName: z.string(), skip: z.number().optional(), take: z.number().optional(), ids: z.array(z.string()).optional(), partialName: z.string().optional(), accountType: z.nativeEnum(AccountType).optional(), },
  • Primary registration function for the 'list_accounts' tool on the MCP server, including name, description, input schema, output hints, and handler.
    export function registerListAccountsTool(server: McpServer) { server.tool( "list_accounts", `List accounts in a space This tool lists all accounts in a given space. The space name is required. You can optionally filter by various parameters like name, account type, etc.`, { spaceName: z.string(), skip: z.number().optional(), take: z.number().optional(), ids: z.array(z.string()).optional(), partialName: z.string().optional(), accountType: z.nativeEnum(AccountType).optional(), }, { title: "List all accounts in an Octopus Deploy space", readOnlyHint: true, }, async ({ spaceName, skip, take, ids, partialName, accountType, }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const response = await client.get<ResourceCollection<AccountResource>>( "~/api/{spaceId}/accounts{?skip,take,ids,partialName,accountType}", { spaceId, skip, take, ids, partialName, accountType, } ); const accounts = response.Items.map((account: AccountResource) => mapAccountResource(account)); return { content: [ { type: "text", text: JSON.stringify({ totalResults: response.TotalResults, itemsPerPage: response.ItemsPerPage, numberOfPages: response.NumberOfPages, lastPageNumber: response.LastPageNumber, items: accounts, }), }, ], }; } ); }
  • Self-registration of the tool definition into the global TOOL_REGISTRY, specifying toolset 'accounts' and read-only nature for conditional enabling in index.ts.
    registerToolDefinition({ toolName: "list_accounts", config: { toolset: "accounts", readOnly: true }, registerFn: registerListAccountsTool, });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/OctopusDeploy/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server