Skip to main content
Glama
tanmay4l

Futarchy MCP Server

by tanmay4l

getProposal

Retrieve a specific proposal by its ID from the Futarchy protocol on Solana to view proposal details and manage DAO governance.

Instructions

Get a specific proposal by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
proposalIdYesThe ID of the proposal to retrieve

Implementation Reference

  • The MCP server.tool registration and inline handler for the 'getProposal' tool. This executes the tool logic by calling the FutarchyApiClient.getProposal method, handling errors, and formatting the response as MCP content.
    server.tool("getProposal", "Get a specific proposal by ID", {
        proposalId: z.string().describe("The ID of the proposal to retrieve"),
    }, async ({ proposalId }) => {
        try {
            const response = await apiClient.getProposal(proposalId);
            if (!response.success) {
                return {
                    content: [
                        {
                            type: "text",
                            text: response.error || 'Unknown error',
                        },
                    ],
                    isError: true,
                };
            }
            return {
                content: [
                    {
                        type: "text",
                        text: JSON.stringify(response.data, null, 2),
                    },
                ],
            };
        }
        catch (error) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Error fetching proposal: ${error.message || 'Unknown error'}`,
                    },
                ],
                isError: true,
            };
        }
    });
  • The core helper function in FutarchyApiClient that fetches the proposal data from the backend API endpoint `/proposals/{proposalId}`, augments it with sentiment analysis, and returns a standardized response.
    async getProposal(proposalId) {
        try {
            const response = await fetch(`${this.baseUrl}/proposals/${proposalId}`);
            if (!response.ok) {
                throw new Error(`HTTP error! Status: ${response.status}`);
            }
            const data = await response.json();
            // Get sentiment analysis for this proposal
            try {
                const sentimentAnalysis = await getProposalSentimentAnalysis(proposalId);
                // Combine proposal data with sentiment analysis
                return {
                    success: true,
                    data: {
                        ...data.proposal,
                        sentimentAnalysis
                    }
                };
            }
            catch (sentimentError) {
                console.error(`Error getting sentiment analysis: ${sentimentError}`);
                // Return proposal data without sentiment analysis if it fails
                return {
                    success: true,
                    data: data.proposal
                };
            }
        }
        catch (error) {
            return {
                success: false,
                error: error.message || `Failed to fetch proposal with ID: ${proposalId}`
            };
        }
  • Zod schema defining the input parameters for the getProposal tool (proposalId: string). Note: Inline schema in handler matches this.
    export const GetProposalParamsSchema = z.object({
        proposalId: z.string().describe("The ID of the proposal to retrieve"),
    });
  • TypeScript declaration for the getProposal method in the API client.
    getProposal(proposalId: string): Promise<Response>;
  • TypeScript declaration exporting the getProposal tool definition.
    export declare const getProposal: ToolDefinition;
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 the action ('Get') but doesn't clarify if this is a read-only operation, what permissions are required, how errors are handled (e.g., invalid ID), or the response format. This leaves critical behavioral traits unspecified for a retrieval 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, direct sentence with zero waste—'Get a specific proposal by ID'—making it highly concise and front-loaded. Every word contributes to understanding the tool's core function 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 tool's complexity (simple retrieval) but lack of annotations and output schema, the description is incomplete. It doesn't explain what a 'proposal' entails in this context, potential return values, or error cases. For a tool with no structured output information, more context is needed to ensure proper usage.

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%, with the parameter 'proposalId' clearly documented in the schema. The description adds no additional meaning beyond implying retrieval by ID, which is already covered. This meets the baseline score of 3, as the schema adequately handles parameter semantics without extra description needed.

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 ('a specific proposal by ID'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'getProposals' (plural) or 'getProposalSentiment', which might retrieve multiple proposals or sentiment data respectively, leaving room for confusion about when to use this exact tool.

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. It doesn't mention siblings like 'getProposals' for listing multiple proposals or 'getProposalSentiment' for sentiment data, nor does it specify prerequisites such as needing a valid proposal ID. This lack of context could lead to incorrect 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/tanmay4l/FutarchyMCPServer'

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