Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

list_spaces

Read-only

Retrieve all organizational spaces in Octopus Deploy to verify availability and manage project, infrastructure, and tenant separation.

Instructions

List all spaces in the Octopus Deploy instance. Spaces is the main organizational unit in Octopus Deploy, Spaces keep the different projects, infrastructure and tenants completely separate. Spaces typically represent team or project boundary, but not customer boundary (use tenants for those). Always use this tool first to check that the requested space exists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
partialNameNo
skipNo
takeNo

Implementation Reference

  • The handler function that implements the core logic of the 'list_spaces' tool. It uses the Octopus Deploy API client to list spaces with optional pagination and filtering, then formats and returns the results as a text content block with JSON data.
    async ({ partialName, skip, take }) => {
      const configuration = getClientConfigurationFromEnvironment();
      const client = await Client.create(configuration);
      const spaceRepository = new SpaceRepository(client);
    
      const spacesResponse = await spaceRepository.list({ partialName, skip, take });
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              totalResults: spacesResponse.TotalResults,
              itemsPerPage: spacesResponse.ItemsPerPage,
              numberOfPages: spacesResponse.NumberOfPages,
              lastPageNumber: spacesResponse.LastPageNumber,
              items: spacesResponse.Items.map((space) => ({
                id: space.Id,
                name: space.Name,
                description: space.Description,
                isDefault: space.IsDefault,
                taskQueueStopped: space.TaskQueueStopped,
              }))
            }),
          },
        ],
      };
    }
  • Input schema using Zod for optional parameters partialName, skip, take; and output metadata indicating read-only nature.
    {
      partialName: z.string().optional(),
      skip: z.number().optional(),
      take: z.number().optional()
    },
    {
      title: "List all spaces in an Octopus Deploy instance",
      readOnlyHint: true,
    },
  • The registerListSpacesTool function that registers the 'list_spaces' tool on the MCP server, including name, description, schema, and handler.
    export function registerListSpacesTool(server: McpServer) {
      server.tool(
        "list_spaces",
        `List all spaces in the Octopus Deploy instance. ${spacesDescription} Always use this tool first to check that the requested space exists.`,
        {
          partialName: z.string().optional(),
          skip: z.number().optional(),
          take: z.number().optional()
        },
        {
          title: "List all spaces in an Octopus Deploy instance",
          readOnlyHint: true,
        },
        async ({ partialName, skip, take }) => {
          const configuration = getClientConfigurationFromEnvironment();
          const client = await Client.create(configuration);
          const spaceRepository = new SpaceRepository(client);
    
          const spacesResponse = await spaceRepository.list({ partialName, skip, take });
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify({
                  totalResults: spacesResponse.TotalResults,
                  itemsPerPage: spacesResponse.ItemsPerPage,
                  numberOfPages: spacesResponse.NumberOfPages,
                  lastPageNumber: spacesResponse.LastPageNumber,
                  items: spacesResponse.Items.map((space) => ({
                    id: space.Id,
                    name: space.Name,
                    description: space.Description,
                    isDefault: space.IsDefault,
                    taskQueueStopped: space.TaskQueueStopped,
                  }))
                }),
              },
            ],
          };
        }
      );
    }
  • Self-registration of the 'list_spaces' tool into the global TOOL_REGISTRY for conditional registration based on toolset config.
    registerToolDefinition({
      toolName: "list_spaces",
      config: { toolset: "core", readOnly: true },
      registerFn: registerListSpacesTool,
    });
  • Import statement in index.ts that loads the listSpaces module, triggering its self-registration.
    import "./listSpaces.js";
Behavior4/5

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

Annotations provide readOnlyHint=true, indicating a safe read operation. The description adds valuable context beyond this by explaining that spaces keep projects, infrastructure, and tenants separate, and that this tool lists all spaces. It does not disclose rate limits, auth needs, or pagination behavior, but with annotations covering safety, it adds meaningful operational context.

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 efficiently structured with three sentences: the first states the purpose, the second explains spaces, and the third provides usage guidance. Each sentence adds distinct value without redundancy, making it front-loaded and concise.

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 the tool's low complexity (list operation with optional pagination/filtering), annotations cover safety, and no output schema exists, the description is reasonably complete. It explains the resource's role and usage context but lacks details on return format or parameter usage, which could be improved for full completeness.

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

Parameters3/5

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

Schema description coverage is 0%, so the schema provides no parameter descriptions. The description does not mention any parameters (partialName, skip, take), so it adds no semantic information beyond the schema. However, with 0 parameters required and a baseline expectation for list operations, this is adequate but minimal.

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 the verb ('List') and resource ('all spaces in the Octopus Deploy instance'), providing specific context about what spaces are ('main organizational unit') and how they function. It distinguishes this tool from siblings by focusing on spaces rather than accounts, deployments, projects, or other resources listed in the sibling tools.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('Always use this tool first to check that the requested space exists'), providing clear guidance on its role as an initial step. It also distinguishes usage by explaining what spaces represent ('team or project boundary') versus alternatives ('use tenants for those'), helping the agent choose appropriately among siblings.

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