Skip to main content
Glama

getSpaces

Retrieve a list of Snapshot spaces to view governance platforms, with options to limit results or skip entries for efficient browsing.

Instructions

Get list of Snapshot spaces

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of spaces to fetch
skipNoNumber of spaces to skip

Implementation Reference

  • Core handler function that performs the GraphQL query to fetch paginated list of Snapshot spaces.
    async getSpaces(first: number = 20, skip: number = 0): Promise<Space[]> {
      const query = `
        query Spaces {
          spaces(
            first: ${first},
            skip: ${skip},
            orderBy: "created",
            orderDirection: asc
          ) {
            id
            name
            about
            network
            symbol
            strategies {
              name
              params
            }
            admins
            members
          }
        }
      `;
    
      const result = await this.queryGraphQL(query);
      return result.spaces;
    }
  • Zod schema for validating input parameters (limit, skip) for the getSpaces tool.
    const SpacesParamsSchema = z.object({
      limit: z.number().optional(),
      skip: z.number().optional()
    });
  • src/server.ts:69-79 (registration)
    Tool registration in the listTools handler, defining name, description, and inputSchema.
    {
      name: "getSpaces",
      description: "Get list of Snapshot spaces",
      inputSchema: {  // Changed from parameters to inputSchema
        type: "object",
        properties: {
          limit: { type: "number", description: "Number of spaces to fetch" },
          skip: { type: "number", description: "Number of spaces to skip" }
        }
      }
    },
  • MCP tool call dispatch handler that validates args, calls the service, and formats response.
    case "getSpaces": {
      const parsedArgs = SpacesParamsSchema.parse(args);
      const spaces = await this.snapshotService.getSpaces(
        parsedArgs.limit || 20,
        parsedArgs.skip || 0
      );
      return {
        content: [{
          type: "text",
          text: JSON.stringify(spaces, null, 2)
        }]
      };
    }
  • TypeScript interface defining the structure of a Space object returned by getSpaces.
    interface Space {
      id: string;
      name: string;
      about?: string;
      network?: string;
      symbol?: string;
      strategies?: any[];
      admins?: string[];
      members?: string[];
    }
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 states this is a 'Get' operation, implying read-only behavior, but doesn't mention authentication requirements, rate limits, pagination behavior, or what the returned list structure looks like. This leaves significant gaps for a list-fetching tool.

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 a single, efficient sentence that states exactly what the tool does with zero wasted words. It's appropriately sized for a simple list-fetching tool and gets straight to the point.

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

Completeness2/5

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

For a list-fetching tool with no annotations and no output schema, the description is inadequate. It doesn't explain what a 'Snapshot space' is, what fields are returned, how pagination works (despite having limit/skip parameters), or any error conditions. The agent would need to guess about the return format and behavior.

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?

The input schema has 100% description coverage, with both 'limit' and 'skip' clearly documented in the schema. The description adds no additional parameter information beyond what's already in the structured schema, so the baseline score of 3 is appropriate.

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 verb ('Get') and resource ('list of Snapshot spaces'), making the purpose immediately understandable. It doesn't differentiate from sibling tools like 'getRankedSpaces' or 'getProposals', but it's specific enough to understand what this tool does.

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 'getRankedSpaces' or 'getProposals'. There's no mention of context, prerequisites, or exclusions, leaving the agent to guess based on tool names alone.

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/crazyrabbitLTC/mcp-snapshot-server'

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