getApiSpecification
Retrieve the complete OpenAPI specification for Adamik API to access detailed schemas, formats, and rules for blockchain transactions across 80+ networks, ensuring precise API integration and error handling.
Instructions
Get the comprehensive OpenAPI specification for the Adamik API covering 80+ blockchain networks. This provides authoritative reference for: • Exact request/response schemas for all transaction types (transfer, stake, unstake, claimRewards, convertAsset, etc.) • Complete chain family details (EVM, Cosmos, Bitcoin, Solana, Starknet, etc.) with supported features • Precise parameter formats (amounts in smallest units, address formats, token IDs, validator addresses) • Transaction encoding formats (RLP, PSBT, BOC, BCS, etc.) and signature requirements • Account state schemas (native/token balances, staking positions, rewards) • Error handling patterns and validation rules • Pagination support for large datasets Use this when you need exact API contract details for blockchain operations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| refresh | No | Optional: refresh the cached specification from API | |
| section | No | Optional: specific section like 'paths', 'components', 'schemas'. If not provided, returns full spec |
Implementation Reference
- src/module.ts:531-548 (handler)Handler function that fetches (with caching) and returns the OpenAPI specification from the Adamik API endpoint, optionally filtered by section.async ({ section, refresh }) => { if (!cachedApiSpec || refresh) { cachedApiSpec = await makeApiRequest<any>( `${ADAMIK_API_BASE_URL.replace("/api", "")}/openapi.json`, ADAMIK_API_KEY ); } const result = section && cachedApiSpec[section] ? cachedApiSpec[section] : cachedApiSpec; return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/module.ts:522-530 (schema)Input parameter schema defined using Zod for optional 'section' and 'refresh' parameters.{ section: z .string() .optional() .describe( "Optional: specific section like 'paths', 'components', 'schemas'. If not provided, returns full spec" ), refresh: z.boolean().optional().describe("Optional: refresh the cached specification from API"), },
- src/module.ts:508-549 (registration)Registration of the getApiSpecification tool on the MCP server, including name, description, input schema, and handler function.server.tool( "getApiSpecification", [ "Get the comprehensive OpenAPI specification for the Adamik API covering 80+ blockchain networks.", "This provides authoritative reference for:", "• Exact request/response schemas for all transaction types (transfer, stake, unstake, claimRewards, convertAsset, etc.)", "• Complete chain family details (EVM, Cosmos, Bitcoin, Solana, Starknet, etc.) with supported features", "• Precise parameter formats (amounts in smallest units, address formats, token IDs, validator addresses)", "• Transaction encoding formats (RLP, PSBT, BOC, BCS, etc.) and signature requirements", "• Account state schemas (native/token balances, staking positions, rewards)", "• Error handling patterns and validation rules", "• Pagination support for large datasets", "Use this when you need exact API contract details for blockchain operations.", ].join(" "), { section: z .string() .optional() .describe( "Optional: specific section like 'paths', 'components', 'schemas'. If not provided, returns full spec" ), refresh: z.boolean().optional().describe("Optional: refresh the cached specification from API"), }, async ({ section, refresh }) => { if (!cachedApiSpec || refresh) { cachedApiSpec = await makeApiRequest<any>( `${ADAMIK_API_BASE_URL.replace("/api", "")}/openapi.json`, ADAMIK_API_KEY ); } const result = section && cachedApiSpec[section] ? cachedApiSpec[section] : cachedApiSpec; return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } );
- src/module.ts:505-506 (helper)In-memory cache variable used by the getApiSpecification handler to store the fetched OpenAPI specification.// Simple in-memory cache for the API spec let cachedApiSpec: any = null;