Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

list_accounts

Retrieve all accounts within a specified Octopus Deploy space. Filter results by name, account type, or other parameters to manage DevOps resources.

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
spaceNameYes
skipNo
takeNo
idsNo
partialNameNo
accountTypeNo

Implementation Reference

  • The handler function for the 'list_accounts' tool. It creates an Octopus Deploy client, resolves the space ID, queries the accounts API with optional filters, maps the account resources, and returns a JSON-formatted text content 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, }), }, ], }; }
  • Zod input schema defining parameters for the list_accounts tool: 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(), },
  • Self-registration of the list_accounts tool definition into the TOOL_REGISTRY via registerToolDefinition, specifying toolset 'accounts' and readOnly: true.
    registerToolDefinition({ toolName: "list_accounts", config: { toolset: "accounts", readOnly: true }, registerFn: registerListAccountsTool, });
  • The registerListAccountsTool function that calls server.tool to register the list_accounts tool with its description, input schema, output hints, and handler on the MCP server.
    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, }), }, ], }; } ); }

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