list_spaces
Retrieve a list of all Confluence spaces accessible to the authenticated user. Optionally set a maximum number of spaces to return.
Instructions
List all Confluence spaces accessible to the authenticated user.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_spaces"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of spaces to return (default: 25, max: 100) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- server.py:102-107 (helper)ConfluenceClient.get_page_content helper method used by the fetch_page_markdown tool.
def get_page_content(self, page_id: str) -> dict: """Fetch a specific page with its content.""" params = { "expand": "body.storage,space,version,metadata.labels" } return self._make_request("GET", f"/content/{page_id}", params=params) - server.py:74-81 (helper)ConfluenceClient.list_spaces helper method that makes the actual API call to Confluence to list spaces.
def list_spaces(self, limit: int = 25) -> list[dict]: """List all accessible Confluence spaces.""" params = { "limit": limit, "type": "global" } response = self._make_request("GET", "/space", params=params) return response.get("results", []) - server.py:114-115 (handler)MCP tool handler for 'list_spaces'. Decorated with @mcp.tool(), it validates limit (1-100), calls confluence.list_spaces(), formats the response as JSON, and returns it.
@mcp.tool() def list_spaces(limit: int = 25) -> str: - server.py:26-27 (registration)FastMCP server initialization. The @mcp.tool() decorator on line 114 registers the list_spaces function as an MCP tool.
mcp = FastMCP("awesome-confluence-mcp")