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
| Name | Required | Description | Default |
|---|---|---|---|
| proposalId | Yes | The ID of the proposal to retrieve |
Implementation Reference
- dist/mcp/server/index.js:161-197 (handler)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, }; } });
- dist/mcp/common/api.js:65-98 (helper)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}` }; }
- dist/mcp/common/types.js:48-50 (schema)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"), });
- dist/mcp/common/api.d.ts:8-8 (schema)TypeScript declaration for the getProposal method in the API client.getProposal(proposalId: string): Promise<Response>;
- dist/mcp/server/tools.d.ts:5-5 (registration)TypeScript declaration exporting the getProposal tool definition.export declare const getProposal: ToolDefinition;