Skip to main content
Glama

getRankedSpaces

Fetch a ranked list of Snapshot governance spaces with filtering options to find relevant DAOs and communities.

Instructions

Get ranked list of Snapshot spaces with detailed information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
firstNoNumber of spaces to fetch (default: 18)
skipNoNumber of spaces to skip (default: 0)
categoryNoCategory to filter by (default: 'all')
searchNoSearch term to filter spaces

Implementation Reference

  • Core handler function that performs the GraphQL query to retrieve ranked Snapshot spaces based on first, skip, category, and optional search parameters.
    async getRankedSpaces(
      first: number = 18, 
      skip: number = 0, 
      category: string = "all",
      search?: string
    ): Promise<RankedSpace[]> {
      const query = `
        query ($first: Int, $skip: Int, $where: RankingWhere) {
          ranking(first: $first, skip: $skip, where: $where) {
            items {
              id
              verified
              turbo
              admins
              members
              name
              avatar
              cover
              network
              about
              website
              twitter
              github
              coingecko
              symbol
              activeProposals
              treasuries {
                name
                network
                address
              }
              labels {
                id
                name
                description
                color
              }
              delegationPortal {
                delegationType
                delegationContract
                delegationNetwork
                delegationApi
              }
              voting {
                delay
                period
                type
                quorum
                quorumType
                privacy
                hideAbstain
              }
              strategies {
                name
                params
                network
              }
              validation {
                name
                params
              }
              filters {
                minScore
                onlyMembers
              }
              proposalsCount
              proposalsCount1d
              proposalsCount30d
              votesCount
              followersCount
              children {
                id
                name
                avatar
                cover
                proposalsCount
                votesCount
                activeProposals
                turbo
                verified
                network
              }
              parent {
                id
                name
                avatar
                cover
                proposalsCount
                votesCount
                activeProposals
                turbo
                verified
                network
              }
              terms
              private
              domain
              skin
              skinSettings {
                bg_color
                link_color
                text_color
                content_color
                border_color
                heading_color
                primary_color
                theme
              }
              guidelines
              template
              categories
              moderators
              plugins
              boost {
                enabled
                bribeEnabled
              }
              voteValidation {
                name
                params
              }
            }
          }
        }
      `;
    
      const variables = {
        first,
        skip,
        where: {
          category,
          ...(search ? { search } : {})
        }
      };
    
      const result = await this.queryGraphQL(query, variables);
      return result.ranking.items;
    }
  • Zod schema used for input parameter validation in the getRankedSpaces tool call handler.
    const RankedSpacesParamsSchema = z.object({
      first: z.number().optional(),
      skip: z.number().optional(),
      category: z.string().optional(),
      search: z.string().optional()
    });
  • src/server.ts:115-127 (registration)
    Tool registration entry in the ListTools response, defining name, description, and input schema for MCP protocol.
    {
      name: "getRankedSpaces",
      description: "Get ranked list of Snapshot spaces with detailed information",
      inputSchema: {
        type: "object",
        properties: {
          first: { type: "number", description: "Number of spaces to fetch (default: 18)" },
          skip: { type: "number", description: "Number of spaces to skip (default: 0)" },
          category: { type: "string", description: "Category to filter by (default: 'all')" },
          search: { type: "string", description: "Search term to filter spaces" }
        }
      }
    }
  • Dispatch handler in the tool call switch statement that validates args, calls the snapshotService, and formats response.
    case "getRankedSpaces": {
      const parsedArgs = RankedSpacesParamsSchema.parse(args);
      const spaces = await this.snapshotService.getRankedSpaces(
        parsedArgs.first || 18,
        parsedArgs.skip || 0,
        parsedArgs.category || "all",
        parsedArgs.search
      );
      return {
        content: [{
          type: "text",
          text: JSON.stringify(spaces, null, 2)
        }]
      };
    }
  • Type definition for the RankedSpace object returned by the GraphQL query in the handler.
    interface RankedSpace {
      id: string;
      verified: boolean;
      turbo: boolean;
      admins: string[];
      members: string[];
      name: string;
      avatar: string;
      cover: string;
      network: string;
      about: string;
      website?: string;
      twitter?: string;
      github?: string;
      coingecko?: string;
      symbol: string;
      activeProposals: number;
      treasuries: {
        name: string;
        network: string;
        address: string;
      }[];
      voting: {
        delay: number;
        period: number;
        type: string;
        quorum: number;
        quorumType: string;
        privacy: string;
        hideAbstain: boolean;
      };
      proposalsCount: number;
      votesCount: number;
      followersCount: number;
      labels: {
        id: string;
        name: string;
        description: string;
        color: string;
      }[];
      delegationPortal: {
        delegationType: string;
        delegationContract: string;
        delegationNetwork: string;
        delegationApi: string;
      };
      strategies: {
        name: string;
        params: any;
        network: string;
      }[];
      validation: {
        name: string;
        params: any;
      };
      filters: {
        minScore: number;
        onlyMembers: boolean;
      };
      proposalsCount1d: number;
      proposalsCount30d: number;
      children: {
        id: string;
        name: string;
        avatar: string;
        cover: string;
        proposalsCount: number;
        votesCount: number;
        activeProposals: number;
        turbo: boolean;
        verified: boolean;
        network: string;
      }[];
      parent: {
        id: string;
        name: string;
        avatar: string;
        cover: string;
        proposalsCount: number;
        votesCount: number;
        activeProposals: number;
        turbo: boolean;
        verified: boolean;
        network: string;
      };
      terms: string;
      private: boolean;
      domain: string;
      skin: string;
      skinSettings: {
        bg_color: string;
        link_color: string;
        text_color: string;
        content_color: string;
        border_color: string;
        heading_color: string;
        primary_color: string;
        theme: string;
      };
      guidelines: string;
      template: string;
      categories: string[];
      moderators: string[];
      plugins: any;
      boost: {
        enabled: boolean;
        bribeEnabled: boolean;
      };
      voteValidation: {
        name: string;
        params: any;
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves a 'ranked list' and 'detailed information', but doesn't explain what 'ranked' means (e.g., by popularity, activity), the format of the detailed information, or any limitations like rate limits or authentication needs. This leaves significant gaps in understanding 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 that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it highly concise and well-structured.

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 the tool's moderate complexity (4 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on behavior, usage guidelines, and output format, which are needed for full contextual understanding, especially without annotations or output schema.

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, clearly documenting all four parameters with defaults and purposes. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline for high schema coverage without compensating further.

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 ranked list') and resource ('Snapshot spaces with detailed information'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'getSpaces' or 'getProposals', which likely retrieve similar data, so it doesn't achieve full sibling differentiation.

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 'getSpaces' or 'getProposals'. There's no mention of specific contexts, prerequisites, or exclusions, leaving the agent without clear usage instructions.

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