Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

add_endpoint

Configure new API endpoints to extend Grove's Pocket Network server capabilities for accessing blockchain data across multiple networks.

Instructions

Dynamically add a new endpoint configuration (for extensibility)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesUnique identifier for the endpoint
nameYesHuman-readable name
pathYesURL path (e.g., "/api/users/:id")
methodYesHTTP method
descriptionYesDescription of what the endpoint does
categoryYesCategory for organization

Implementation Reference

  • The handler logic for the 'add_endpoint' tool within the handleEndpointTool function. It calls 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,
        };
      }
    }
  • Registration of the 'add_endpoint' tool in the tools array returned by registerEndpointHandlers, including 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'],
      },
    },
  • The core helper method addEndpoint in EndpointManager class that actually adds the new endpoint to the config, checks for duplicates, and updates categories.
    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);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It states 'dynamically add' implying a write operation, but doesn't disclose behavioral traits such as required permissions, whether it's idempotent, error handling, or rate limits. This leaves significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste, front-loading the key action and purpose. It's appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a mutation tool with 6 parameters, the description is incomplete. It lacks details on behavior, return values, or error cases, making it inadequate for safe and effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 6 parameters. The description adds no additional meaning beyond implying configuration for extensibility, which doesn't enhance parameter understanding. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('add') and resource ('endpoint configuration'), specifying it's for 'extensibility'. However, it doesn't differentiate from sibling tools like 'list_endpoints' or 'get_endpoint_details', which are read operations, making it clear but not sibling-distinct.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_endpoints' or 'get_endpoint_details', nor does it mention prerequisites or exclusions. It implies a creation context but lacks explicit usage rules.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/buildwithgrove/mcp-pocket'

If you have feedback or need assistance with the MCP directory API, please join our Discord server