Skip to main content
Glama

list_proposals

Fetch recent governance proposals from a Snapshot space to track decentralized decision-making. Provide the space identifier to retrieve up to 10 proposals.

Instructions

Fetch a list of recent proposals for a given Snapshot space.

Parameters:
    space_id (str): The unique identifier of the Snapshot space (e.g., 'ens.eth').

Returns:
    A formatted string containing details of up to 10 recent proposals.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
space_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:60-106 (handler)
    The core handler function that executes the tool logic: queries the Snapshot GraphQL API for the 10 most recent proposals in the given space_id, formats their details using ts2str helper, and returns a string summary.
    async def list_proposals(space_id: str, ctx: Context) -> str:
        """
        Fetch a list of recent proposals for a given Snapshot space.
        
        Parameters:
            space_id (str): The unique identifier of the Snapshot space (e.g., 'ens.eth').
        
        Returns:
            A formatted string containing details of up to 10 recent proposals.
        """
        query = """
        query Proposals($space: String!) {
          proposals(first: 10, orderBy: "created", orderDirection: desc, where: { space: $space }) {
            id
            title
            state
            created
            end
          }
        }
        """
        async with httpx.AsyncClient() as client:
            try:
                response = await client.post(
                    SNAPSHOT_API,
                    json={"query": query, "variables": {"space": space_id}}
                )
                response.raise_for_status()
                data = response.json()
                proposals = data.get("data", {}).get("proposals", [])
                
                # Format proposals as a readable string
                result = []
                for i, proposal in enumerate(proposals):
                    created_str = ts2str(proposal['created'])
                    end_str = ts2str(proposal['end'])
                    result.append(
                        f"Proposal ID: {proposal['id']}\n"
                        f"Title: {proposal['title']}\n"
                        f"State: {proposal['state']}\n"
                        f"Created: {created_str}\n"
                        f"End: {end_str}\n"
                        "---"
                    )
                return "\n".join(result) if result else "No proposals found"
            except Exception as e:
                return f"Error: {str(e)}"
  • main.py:59-59 (registration)
    The @mcp.tool() decorator from FastMCP registers the list_proposals function as an available MCP tool.
    @mcp.tool()
  • main.py:61-69 (schema)
    Docstring providing schema details: input parameter space_id (str), output str with formatted proposal list. Type hints reinforce this.
    """
    Fetch a list of recent proposals for a given Snapshot space.
    
    Parameters:
        space_id (str): The unique identifier of the Snapshot space (e.g., 'ens.eth').
    
    Returns:
        A formatted string containing details of up to 10 recent proposals.
    """
  • main.py:13-15 (helper)
    Supporting utility function to convert Unix timestamps from the API into human-readable datetime strings, used in the proposal formatting.
    def ts2str(ts: int) -> str:
      dt = datetime.fromtimestamp(ts)
      return dt.strftime("%Y-%m-%d %H:%M:%S")
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 fetching 'up to 10 recent proposals', which implies a limit and recency constraint, but doesn't cover other key behaviors such as error handling, authentication needs, rate limits, or whether the operation is read-only or has side effects. This leaves significant gaps in understanding how the tool behaves beyond basic functionality.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the core purpose followed by parameter and return details in a structured format. Every sentence adds value without redundancy, making it efficient and easy to parse, though minor improvements in flow could elevate it further.

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 low complexity (one parameter) and the presence of an output schema (which handles return value details), the description is reasonably complete for basic use. However, it lacks context on usage guidelines and behavioral aspects like error handling or limits, which are important for a tool interacting with external data (Snapshot space), leaving room for improvement in overall completeness.

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 description adds some meaning by explaining that 'space_id' is 'The unique identifier of the Snapshot space (e.g., 'ens.eth')', which clarifies its purpose beyond the schema's bare 'Space Id' title. However, with schema description coverage at 0% and only one parameter, this addition is minimal but sufficient to meet the baseline, as the schema alone lacks descriptive detail.

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 ('Fetch a list') and resource ('recent proposals for a given Snapshot space'), making the purpose understandable. It doesn't explicitly differentiate from sibling tools like 'get_proposal_details' (which fetches details of a single proposal) or 'list_spaces' (which lists spaces rather than proposals), but the specificity is adequate for understanding the tool's function.

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 'get_proposal_details' or 'list_spaces'. It mentions 'recent proposals' but doesn't specify criteria for 'recent' or explain why one might choose this over other tools, leaving the agent with insufficient context for optimal tool selection.

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