Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

list_spaces

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";

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