Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

list_accounts

Read-only

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,
                }),
              },
            ],
          };
        }
      );
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations provide readOnlyHint=true, so the agent knows this is a safe read operation. The description adds that it 'lists all accounts' and mentions optional filtering, which provides some behavioral context beyond annotations. However, it doesn't disclose important behaviors like pagination (skip/take parameters), rate limits, or authentication requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with three sentences. The first sentence states the core purpose, the second elaborates, and the third mentions optional filtering. No wasted words, though it could be slightly more structured with clearer separation of required vs optional parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (6 parameters, no output schema), the description is minimally adequate. It covers the basic purpose and some filtering options but lacks details on pagination behavior, response format, and error conditions. With annotations covering read-only safety, it meets baseline completeness but could be more comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate but only partially does so. It mentions 'space name is required' and 'optionally filter by various parameters like name, account type, etc.', which covers spaceName, partialName, and accountType but ignores skip, take, and ids parameters. This leaves half the parameters without semantic explanation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'List accounts in a space' and 'lists all accounts in a given space', which is a specific verb+resource combination. It distinguishes from sibling 'get_account' (singular vs plural) but doesn't explicitly differentiate from other list_* tools like list_certificates or list_tenants.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions optional filtering parameters but doesn't specify when to use filtering versus the base list operation, nor does it compare to sibling tools like get_account for retrieving a single account.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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