Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

Find accounts in an Octopus Deploy space

find_accounts
Read-onlyIdempotent

Retrieve a specific account by ID or list all accounts in a space with optional filters like name or account type.

Instructions

Find accounts in a space - can retrieve a single account by ID or list all accounts

This unified tool can either:

  • Get detailed information about a specific account when accountId is provided

  • List all accounts in a space when accountId is omitted

You can optionally filter by various parameters like name, account type, etc. when listing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceNameYes
accountIdNoThe ID of a specific account to retrieve. If omitted, lists all accounts.
skipNoNumber of accounts to skip for pagination (only used when listing)
takeNoNumber of accounts to take for pagination (only used when listing)
idsNoFilter by specific account IDs (only used when listing)
partialNameNoFilter by partial name match (only used when listing)
accountTypeNoFilter by account type (only used when listing)

Implementation Reference

  • The main handler function for the find_accounts tool. Registers the tool on the MCP server with logic to either fetch a single account by ID (lines 51-79) or list accounts with pagination/filtering (lines 82-110). Uses the Octopus Deploy API client to call ~/api/{spaceId}/accounts/{id} or ~/api/{spaceId}/accounts endpoints.
    export function registerFindAccountsTool(server: McpServer) {
      server.registerTool(
        "find_accounts",
        {
          title: "Find accounts in an Octopus Deploy space",
          description: `Find accounts in a space - can retrieve a single account by ID or list all accounts
    
    This unified tool can either:
    - Get detailed information about a specific account when accountId is provided
    - List all accounts in a space when accountId is omitted
    
    You can optionally filter by various parameters like name, account type, etc. when listing.`,
          inputSchema: {
            spaceName: z.string(),
            accountId: z.string().optional().describe("The ID of a specific account to retrieve. If omitted, lists all accounts."),
            skip: z.number().optional().describe("Number of accounts to skip for pagination (only used when listing)"),
            take: z.number().optional().describe("Number of accounts to take for pagination (only used when listing)"),
            ids: z.array(z.string()).optional().describe("Filter by specific account IDs (only used when listing)"),
            partialName: z.string().optional().describe("Filter by partial name match (only used when listing)"),
            accountType: z.nativeEnum(AccountType).optional().describe("Filter by account type (only used when listing)"),
          },
          annotations: READ_ONLY_TOOL_ANNOTATIONS,
        },
        async ({
          spaceName,
          accountId,
          skip,
          take,
          ids,
          partialName,
          accountType,
        }) => {
          const configuration = getClientConfigurationFromEnvironment();
          const client = await Client.create(configuration);
          const spaceId = await resolveSpaceId(client, spaceName);
    
          // If accountId is provided, get a single account
          if (accountId) {
            validateEntityId(accountId, 'account', ENTITY_PREFIXES.account);
    
            try {
              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),
                  },
                ],
              };
            } catch (error) {
              handleOctopusApiError(error, {
                entityType: 'account',
                entityId: accountId,
                spaceName
              });
            }
          }
    
          // Otherwise, list all accounts
          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 for the find_accounts tool. Defines spaceName (required), accountId (optional), skip, take, ids, partialName, and accountType filters using Zod validation with native enum for AccountType.
        {
          title: "Find accounts in an Octopus Deploy space",
          description: `Find accounts in a space - can retrieve a single account by ID or list all accounts
    
    This unified tool can either:
    - Get detailed information about a specific account when accountId is provided
    - List all accounts in a space when accountId is omitted
    
    You can optionally filter by various parameters like name, account type, etc. when listing.`,
          inputSchema: {
            spaceName: z.string(),
            accountId: z.string().optional().describe("The ID of a specific account to retrieve. If omitted, lists all accounts."),
            skip: z.number().optional().describe("Number of accounts to skip for pagination (only used when listing)"),
            take: z.number().optional().describe("Number of accounts to take for pagination (only used when listing)"),
            ids: z.array(z.string()).optional().describe("Filter by specific account IDs (only used when listing)"),
            partialName: z.string().optional().describe("Filter by partial name match (only used when listing)"),
            accountType: z.nativeEnum(AccountType).optional().describe("Filter by account type (only used when listing)"),
          },
          annotations: READ_ONLY_TOOL_ANNOTATIONS,
        },
  • Self-registration of the find_accounts tool into the TOOL_REGISTRY with toolset 'accounts' and readOnly: true.
    registerToolDefinition({
      toolName: "find_accounts",
      config: { toolset: "accounts", readOnly: true },
      registerFn: registerFindAccountsTool,
    });
  • Import line in index.ts that triggers self-registration of findAccounts.ts when the tools module is loaded.
    import "./findAccounts.js";
    import "./findInterruptions.js";
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true. Description adds details about dual behavior and pagination parameters, enhancing transparency beyond annotations.

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

Conciseness5/5

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

The description is concise: 3 lines, front-loaded with purpose, then enumerates behaviors. Every sentence is meaningful with no redundancy.

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

Completeness4/5

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

Given 7 parameters and no output schema, the description covers the two scenarios (get vs list) and filtering options. It lacks explicit return value details, but the dual behavior and pagination are well explained.

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

Parameters4/5

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

Schema coverage is 86%, and each parameter has a description in the schema. The description adds context by explaining the accountId role and that many params are only used when listing, which adds moderate value beyond schema.

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

Purpose5/5

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

The description clearly states it finds accounts in a space, with the ability to retrieve a single account by ID or list all accounts. It distinguishes itself from sibling tools like find_certificates and find_tenants by specifying its resource and dual behavior.

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

Usage Guidelines4/5

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

Explicitly explains when to use each mode: accountId for a specific account, omit for listing. It provides context on optional filters but doesn't explicitly say when not to use or suggest alternatives.

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