Skip to main content
Glama

getProposals

Retrieve governance proposals from a Snapshot space to analyze voting activity, filter by state, and track decision-making processes.

Instructions

Get proposals for a Snapshot space

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceIdYesID of the space
stateNoFilter by proposal state (active, closed, pending, all)
limitNoNumber of proposals to fetch

Implementation Reference

  • MCP tool handler for 'getProposals': parses arguments using ProposalsParamsSchema, calls snapshotService.getProposals with spaceId, state, and limit, and returns the proposals as JSON text content.
    case "getProposals": {
      const parsedArgs = ProposalsParamsSchema.parse(args);
      const proposals = await this.snapshotService.getProposals(
        parsedArgs.spaceId,
        parsedArgs.state || "all",
        parsedArgs.limit || 20
      );
      return {
        content: [{
          type: "text",
          text: JSON.stringify(proposals, null, 2)
        }]
      };
    }
  • Zod schema (ProposalsParamsSchema) for input validation of getProposals tool: requires spaceId, optional state and limit.
    const ProposalsParamsSchema = z.object({
      spaceId: z.string(),
      state: z.string().optional(),
      limit: z.number().optional()
    });
  • src/server.ts:80-92 (registration)
    Tool registration in listTools handler: defines 'getProposals' with description and inputSchema matching the Zod schema.
    {
      name: "getProposals",
      description: "Get proposals for a Snapshot space",
      inputSchema: {  // Changed from parameters to inputSchema
        type: "object",
        properties: {
          spaceId: { type: "string", description: "ID of the space" },
          state: { type: "string", description: "Filter by proposal state (active, closed, pending, all)" },
          limit: { type: "number", description: "Number of proposals to fetch" }
        },
        required: ["spaceId"]
      }
    },
  • Core implementation of getProposals in SnapshotService: constructs and executes GraphQL query to fetch proposals for a space, filtered by state if specified, returns Proposal[].
    async getProposals(spaceId: string, state: string = "all", first: number = 20): Promise<Proposal[]> {
      const query = `
        query Proposals {
          proposals (
            first: ${first},
            skip: 0,
            where: {
              space_in: ["${spaceId}"]
              ${state !== "all" ? `, state: "${state}"` : ''}
            },
            orderBy: "created",
            orderDirection: desc
          ) {
            id
            title
            body
            choices
            start
            end
            snapshot
            state
            author
            space {
              id
              name
            }
          }
        }
      `;
    
      const result = await this.queryGraphQL(query);
      return result.proposals;
    }
  • TypeScript interface Proposal defining the structure of proposal objects returned by getProposals.
    interface Proposal {
      id: string;
      title: string;
      body?: string;
      choices: string[];
      start: number;
      end: number;
      snapshot: string;
      state: string;
      author: string;
      space: {
        id: string;
        name: 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 mentions 'Get proposals' but doesn't specify whether this is a read-only operation, if it requires authentication, how results are returned (e.g., pagination), or any rate limits. This leaves significant gaps for an agent to understand the tool's behavior.

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 with no wasted words. It is appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration.

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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'proposals' entail in this context, how results are structured, or any behavioral traits like error handling. For a tool with 3 parameters and no structured support, more context is needed.

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 schema description coverage is 100%, so the input schema already documents all parameters (spaceId, state, limit) with clear descriptions. The description adds no additional meaning beyond what the schema provides, resulting in a baseline score of 3.

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 action ('Get') and resource ('proposals for a Snapshot space'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'getProposal' (singular vs. plural) or 'getSpaces' (proposals vs. spaces), which prevents a perfect score.

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?

No guidance is provided on when to use this tool versus alternatives like 'getProposal' (for a single proposal) or 'getSpaces' (for listing spaces). The description only states what it does without context about usage scenarios 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/crazyrabbitLTC/mcp-snapshot-server'

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