get_governance_proposals
Retrieve active governance proposals from the Penumbra blockchain to stay informed about ongoing community decisions and voting processes.
Instructions
Get active governance proposals
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | Filter proposals by status | active |
Implementation Reference
- src/index.ts:322-357 (handler)The handler function that executes the get_governance_proposals tool logic. It returns mock data for governance proposals filtered by status, with error handling.private async getGovernanceProposals(status: string) { try { // TODO: Implement actual governance proposals query return { content: [ { type: 'text', text: JSON.stringify({ proposals: [ { id: "1", title: "Example Proposal", status: "active", votingEndTime: new Date(Date.now() + CONFIG.governance.votingPeriod).toISOString(), minDeposit: CONFIG.governance.minDepositAmount, yesVotes: "750000", noVotes: "250000" } ] }, null, 2), }, ], }; } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred'; return { content: [ { type: 'text', text: `Error fetching governance proposals: ${errorMessage}`, }, ], isError: true, }; } }
- src/index.ts:136-151 (registration)Registration of the get_governance_proposals tool in the MCP server tools list, including name, description, and input schema.{ name: 'get_governance_proposals', description: 'Get active governance proposals', inputSchema: { type: 'object', properties: { status: { type: 'string', enum: ['active', 'completed', 'all'], description: 'Filter proposals by status', default: 'active' } }, required: [], }, }
- src/index.ts:139-150 (schema)Input schema definition for the get_governance_proposals tool, specifying the optional 'status' parameter with enum values.inputSchema: { type: 'object', properties: { status: { type: 'string', enum: ['active', 'completed', 'all'], description: 'Filter proposals by status', default: 'active' } }, required: [], },
- src/index.ts:171-174 (handler)Dispatcher case in the CallToolRequestHandler that invokes the getGovernanceProposals handler with parsed status argument.case 'get_governance_proposals': return await this.getGovernanceProposals( (request.params.arguments?.status as string) || 'active' );