Skip to main content
Glama

list_spaces

Fetch available Snapshot spaces to identify governance platforms for tracking DAO proposals and decentralized decision-making.

Instructions

Fetch a list of available Snapshot spaces.

Parameters:
    None

Returns:
    A formatted string containing space IDs and names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:18-56 (handler)
    The handler function for the 'list_spaces' tool. It uses a GraphQL query to fetch the latest 10 Snapshot spaces, formats their ID, name, and about text, and returns as a string. Includes error handling.
    @mcp.tool()
    async def list_spaces(ctx: Context) -> str:
        """
        Fetch a list of available Snapshot spaces.
        
        Parameters:
            None
        
        Returns:
            A formatted string containing space IDs and names.
        """
        query = """
        query Spaces {
          spaces(first: 10, orderBy: "created", orderDirection: desc) {
            id
            name
            about
          }
        }
        """
        async with httpx.AsyncClient() as client:
            try:
                response = await client.post(SNAPSHOT_API, json={"query": query})
                response.raise_for_status()
                data = response.json()
                spaces = data.get("data", {}).get("spaces", [])
                
                # Format spaces as a readable string
                result = []
                for i, space in enumerate(spaces):
                    result.append(
                        f"Space ID: {space['id']}\n"
                        f"Name: {space['name']}\n"
                        f"About: {space['about']}\n"
                        "---"
                    )
                return "\n".join(result) if result else "No spaces found"
            except Exception as e:
                return f"Error: {str(e)}"
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return format ('formatted string containing space IDs and names') but doesn't address important aspects like whether this is a read-only operation, potential rate limits, authentication requirements, or how the data is structured beyond IDs and names.

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 perfectly concise and well-structured with three brief sentences that each serve a distinct purpose: stating the action, clarifying parameters, and describing returns. There's no wasted language or redundancy.

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

Completeness3/5

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

Given that this is a simple listing tool with 0 parameters and an output schema exists, the description is adequate but has gaps. It doesn't explain behavioral aspects like read-only nature or potential constraints, and while the output schema will document return structure, the description could better prepare the agent for what to expect.

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?

The description explicitly states 'Parameters: None', which adds clarity beyond what the empty input schema already indicates. With 0 parameters and 100% schema coverage, this provides complete parameter information, though the baseline for 0 parameters is 4 rather than 5 since there's minimal semantic value to add.

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

Purpose4/5

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

The description clearly states the tool's purpose with a specific verb ('Fetch') and resource ('Snapshot spaces'), making it easy to understand what it does. However, it doesn't differentiate from sibling tools like 'list_proposals', which appears to be a similar listing operation for a different resource type.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'list_proposals' or 'get_proposal_details'. It simply states what the tool does without any context about appropriate use cases, prerequisites, or exclusions.

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/kukapay/dao-proposals-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server