Skip to main content
Glama

getProposal

Retrieve a specific proposal by ID using the Futarchy MCP Server to manage DAOs and proposals on the Solana protocol through API or chat interfaces.

Instructions

Get a specific proposal by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
proposalIdYesThe ID of the proposal to retrieve

Implementation Reference

  • Handler function that executes the getProposal tool: destructures proposalId, calls apiClient.getProposal, handles success/error by returning MCP formatted content with JSON stringified data or error text.
    async ({ proposalId }) => { try { const response = await apiClient.getProposal(proposalId); if (!response.success) { return { content: [ { type: "text" as const, text: response.error || 'Unknown error', }, ], isError: true, }; } return { content: [ { type: "text" as const, text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error: any) { return { content: [ { type: "text" as const, text: `Error fetching proposal: ${error.message || 'Unknown error'}`, }, ], isError: true, }; } }
  • Registration of the 'getProposal' tool on the MCP server using server.tool(name, description, inputSchema, handler), with inline Zod schema.
    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" as const, text: response.error || 'Unknown error', }, ], isError: true, }; } return { content: [ { type: "text" as const, text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error: any) { return { content: [ { type: "text" as const, text: `Error fetching proposal: ${error.message || 'Unknown error'}`, }, ], isError: true, }; } } );
  • Zod schema definition for GetProposalParamsSchema used potentially in tool definitions.
    export const GetProposalParamsSchema = z.object({ proposalId: z.string().describe("The ID of the proposal to retrieve"), });
  • FutarchyApiClient.getProposal helper: HTTP fetch proposal from backend, augments with sentiment analysis from getProposalSentimentAnalysis.
    async getProposal(proposalId: string): Promise<Response> { 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: any) { return { success: false, error: error.message || `Failed to fetch proposal with ID: ${proposalId}` }; } }

Other Tools

Related 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/TanmayDhobale/FutarchyMCPServer'

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