Skip to main content
Glama

call_api_endpoint

Execute API requests on the Hive Intelligence server by specifying the endpoint name and required arguments, ensuring compliance with the provided schema.

Instructions

call an endpoint in the HIVE API. Note: use the category endpoints to get the list of endpoints and get_api_endpoint_schema tool to get the schema for an endpoint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsYesThe arguments to pass to the endpoint. This must match the schema returned by the `get_api_endpoint_schema` tool.
endpoint_nameYesThe name of the endpoint to call.

Implementation Reference

  • Specific handler logic for 'call_api_endpoint' within the dynamicToolsHandler method. It extracts endpoint_name and args from the request, proxies the call to the HIVE API execute endpoint via fetch, handles the response, and formats it as MCP content.
    if(request.params.name == "call_api_endpoint"){
      const toolName:any= request.params.arguments?.endpoint_name
      
      try {
        // Call the API server's /execute endpoint
        const response = await fetch(API_EXECUTE_ENDPOINT, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({
            toolName: toolName,
            arguments: request.params.arguments?.args
          })
        });
    
        const result = await response.json();
        
        if (!response.ok) {
          
          return {
            content: [
              {
                type: "text",
                text: `Error executing hive tool: ${result.error || 'Request failed'}`,
              },
            ],
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
        
      } catch (error) {
        
        return {
          content: [
            {
              type: "text",
              text: `Error executing hive tool: ${error}`,
            },
          ],
        };
      }
  • Zod schema defining the input validation for the 'call_api_endpoint' tool: endpoint_name (string) and args (record of string to any).
    const callEndpointSchema = z.object({
      endpoint_name: z.string().describe('The name of the endpoint to call.'),
      args: z
        .record(z.string(), z.any())
        .describe(
          'The arguments to pass to the endpoint. This must match the schema returned by the `get_api_endpoint_schema` tool.',
        ),
    });
  • Tool registration object for 'call_api_endpoint' including metadata, tool definition with name, description, inputSchema, and placeholder handler (null, handled specially elsewhere).
    const callEndpointTool = {
      metadata: {
        resource: 'dynamic_tools',
        operation: 'write' as const,
        tags: [],
      },
      tool: {
        name: 'call_api_endpoint',
        description:
          'call an endpoint in the HIVE API. Note: use the category endpoints to get the list of endpoints and `get_api_endpoint_schema` tool to get the schema for an endpoint.',
        inputSchema: zodToInputSchema(callEndpointSchema),
      },
      handler: null
    };
  • The dynamicTools function returns an array including the callEndpointTool, which is then processed and registered in the MCP server tools list.
    return [getEndpointTool, callEndpointTool, ...categoryTools];
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool calls an API endpoint but lacks details on authentication requirements, rate limits, error handling, or what the response entails. For a tool that performs API calls with potential side effects, this is a significant gap in transparency.

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 highly concise and front-loaded, consisting of two sentences that directly address the tool's purpose and usage guidelines. There is no wasted text, and every sentence contributes essential information, making it efficient and well-structured.

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 the complexity of calling arbitrary API endpoints, the lack of annotations, and no output schema, the description is insufficient. It doesn't cover behavioral aspects like authentication, error handling, or response format, leaving critical gaps for an agent to use the tool effectively in a real-world context.

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?

The schema description coverage is 100%, with both parameters ('endpoint_name' and 'args') well-documented in the input schema. The description adds minimal value by referencing the 'get_api_endpoint_schema' tool for schema matching, but it doesn't provide additional semantic context beyond what the schema already states. This meets the baseline for high schema coverage.

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 tool's purpose: 'call an endpoint in the HIVE API.' It specifies the verb ('call') and resource ('endpoint in the HIVE API'), making the action explicit. However, it doesn't distinguish this from sibling tools that also interact with endpoints (like 'get_api_endpoint_schema'), which slightly reduces clarity.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool: it instructs to first use 'category endpoints' to list endpoints and then 'get_api_endpoint_schema' to obtain the schema before calling this tool. This sets clear prerequisites and distinguishes it from alternatives by outlining a workflow.

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/hive-intel/hive-crypto-mcp'

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