get_validator_set
Retrieve the current validator set information for the Penumbra blockchain, enabling users to access critical data about active validators for transactions and governance.
Instructions
Get the current validator set information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:184-217 (handler)The main handler function for the 'get_validator_set' tool. It currently returns mock validator data with fields like address, votingPower, commission, and status. Includes error handling.private async getValidatorSet() { try { // TODO: Implement actual validator set query using Penumbra client // For now returning mock data until we integrate the proper client const mockValidators: ValidatorInfo[] = [ { address: "penumbrav1xyz...", votingPower: "1000000", commission: "0.05", status: "active" } ]; return { content: [ { type: 'text', text: JSON.stringify({ validators: mockValidators }, null, 2), }, ], }; } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred'; return { content: [ { type: 'text', text: `Error fetching validator set: ${errorMessage}`, }, ], isError: true, }; } }
- src/index.ts:98-102 (schema)Input schema for the 'get_validator_set' tool, which takes no parameters (empty object).inputSchema: { type: 'object', properties: {}, required: [], },
- src/index.ts:96-103 (registration)Registration of the 'get_validator_set' tool in the ListTools response, including name, description, and schema.name: 'get_validator_set', description: 'Get the current validator set information', inputSchema: { type: 'object', properties: {}, required: [], }, },
- src/index.ts:157-158 (registration)Dispatcher case in the CallToolRequest handler that routes to the getValidatorSet method.case 'get_validator_set': return await this.getValidatorSet();