confluence_list_spaces
List all Confluence spaces accessible to your account. Optionally set a limit to reduce the results.
Instructions
List all Confluence spaces accessible to the user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of spaces to return (default: 25) |
Implementation Reference
- index.js:67-76 (helper)The `listSpaces` helper function that calls the Confluence REST API `/space` endpoint to list all accessible spaces. It accepts an optional `limit` parameter (default 25).
async function listSpaces(limit = 25) { try { const response = await client.get(`${CONFLUENCE_API_BASE}/space`, { params: { limit } }); return response.data; } catch (error) { throw new Error(`Failed to list spaces: ${error.message}`); } } - index.js:252-264 (schema)Tool registration schema for `confluence_list_spaces`. Defines the name, description, and input schema (optional `limit` parameter).
{ name: 'confluence_list_spaces', description: 'List all Confluence spaces accessible to the user', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Maximum number of spaces to return (default: 25)', }, }, }, }, - index.js:422-432 (handler)The request handler case for `confluence_list_spaces` in the CallToolRequestSchema switch. Calls `listSpaces(args.limit || 25)` and returns the result as JSON text.
case 'confluence_list_spaces': { const result = await listSpaces(args.limit || 25); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }