getChainValidators
Retrieve a list of validators for a specific blockchain chain to assist users in delegating stakes. Designed for use with the Adamik MCP Server, which supports multi-chain interactions.
Instructions
Gets the list of known validators for a given chain. This is only useful when asking the user to select a validator to delegate to
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainId | Yes |
Implementation Reference
- src/module.ts:388-403 (handler)The handler function that makes an API request to fetch the list of validators for the given chainId (with optional pagination via nextPage) and returns the JSON stringified response as text content.async ({ chainId, nextPage }: GetChainValidatorsPathParams & GetChainValidatorsQueryParams) => { const validators = await makeApiRequest<GetChainValidatorsResponse>( `${ADAMIK_API_BASE_URL}/${chainId}/validators${nextPage ? `?nextPage=${nextPage}` : ""}`, ADAMIK_API_KEY ); const text = JSON.stringify(validators); return { content: [ { type: "text", text, }, ], }; }
- src/module.ts:382-404 (registration)The server.tool() call that registers the 'getChainValidators' tool, providing its name, description, input schema (chainId), and the handler function.server.tool( "getChainValidators", "Gets the list of known validators for a given chain. This is only useful when asking the user to select a validator to delegate to", { chainId: ChainIdSchema, }, async ({ chainId, nextPage }: GetChainValidatorsPathParams & GetChainValidatorsQueryParams) => { const validators = await makeApiRequest<GetChainValidatorsResponse>( `${ADAMIK_API_BASE_URL}/${chainId}/validators${nextPage ? `?nextPage=${nextPage}` : ""}`, ADAMIK_API_KEY ); const text = JSON.stringify(validators); return { content: [ { type: "text", text, }, ], }; } );
- src/schemas.ts:155-170 (schema)Zod schemas defining the input path parameters (chainId), query parameters (nextPage), and response structure (validators list with pagination) for the getChainValidators tool.export const GetChainValidatorsPathParamsSchema = z.object({ chainId: ChainIdSchema, }); export type GetChainValidatorsPathParams = z.infer<typeof GetChainValidatorsPathParamsSchema>; export const GetChainValidatorsQueryParamsSchema = z.object({ nextPage: z.string().optional(), }); export type GetChainValidatorsQueryParams = z.infer<typeof GetChainValidatorsQueryParamsSchema>; export const GetChainValidatorsResponseSchema = z.object({ chainId: ChainIdSchema, validators: z.array(ValidatorSchema), pagination: PaginationSchema, }); export type GetChainValidatorsResponse = z.infer<typeof GetChainValidatorsResponseSchema>;