add_endpoint
Dynamically add new endpoint configurations to extend blockchain data access across 70+ networks including Ethereum, Solana, Cosmos, and Sui.
Instructions
Dynamically add a new endpoint configuration (for extensibility)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes | Category for organization | |
| description | Yes | Description of what the endpoint does | |
| id | Yes | Unique identifier for the endpoint | |
| method | Yes | HTTP method | |
| name | Yes | Human-readable name | |
| path | Yes | URL path (e.g., "/api/users/:id") |
Implementation Reference
- Executes the 'add_endpoint' tool by calling endpointManager.addEndpoint with the provided arguments and returns a success or error response.case 'add_endpoint': { const endpoint = args as any; try { endpointManager.addEndpoint(endpoint); return { content: [ { type: 'text', text: `Successfully added endpoint: ${endpoint.id}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: error instanceof Error ? error.message : 'Failed to add endpoint', }, ], isError: true, }; } }
- src/handlers/endpoint-handlers.ts:76-110 (registration)Registers the 'add_endpoint' tool with the MCP server, including its name, description, and input schema.{ name: 'add_endpoint', description: 'Dynamically add a new endpoint configuration (for extensibility)', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'Unique identifier for the endpoint', }, name: { type: 'string', description: 'Human-readable name', }, path: { type: 'string', description: 'URL path (e.g., "/api/users/:id")', }, method: { type: 'string', enum: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'], description: 'HTTP method', }, description: { type: 'string', description: 'Description of what the endpoint does', }, category: { type: 'string', description: 'Category for organization', }, }, required: ['id', 'name', 'path', 'method', 'description', 'category'], }, },
- Implements the core logic for adding a new endpoint to the configuration, including existence check and category management.addEndpoint(endpoint: EndpointConfig): void { // Check if endpoint already exists if (this.config.endpoints.find(ep => ep.id === endpoint.id)) { throw new Error(`Endpoint with ID ${endpoint.id} already exists`); } // Add category if it doesn't exist if (!this.config.categories.includes(endpoint.category)) { this.config.categories.push(endpoint.category); } this.config.endpoints.push(endpoint); }