Skip to main content
Glama
fikri2992

MCP API Server

by fikri2992

api_get

Make HTTP GET requests to external APIs through the MCP API Server, enabling AI assistants to retrieve data from specified URLs with optional headers.

Instructions

Make an HTTP GET request to the specified URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to make the GET request to
headersNoOptional headers to include in the request

Implementation Reference

  • Defines the MCPTool object for 'api_get' including name, description, and input schema.
    export const API_GET_TOOL: MCPTool = {
      name: 'api_get',
      description: 'Make an HTTP GET request to the specified URL',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            format: 'uri',
            description: 'The URL to make the GET request to',
          },
          headers: {
            type: 'object',
            description: 'Optional headers to include in the request',
            additionalProperties: {
              type: 'string',
            },
          },
        },
        required: ['url'],
      },
    };
  • src/tools.ts:128-133 (registration)
    Registers 'api_get' tool (via API_GET_TOOL) in the ALL_API_TOOLS array used by the MCP server's list_tools handler.
    export const ALL_API_TOOLS: MCPTool[] = [
      API_GET_TOOL,
      API_POST_TOOL,
      API_PUT_TOOL,
      API_DELETE_TOOL,
    ];
  • Registers the list_tools MCP request handler that returns all tools including 'api_get'.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => {
      this.log('Received list_tools request');
      return {
        tools: ALL_API_TOOLS,
      };
    });
  • Tool dispatch handler that routes 'api_get' calls to APIClient.get() method after validation.
    switch (toolName) {
      case 'api_get':
        return await this.apiClient.get(validatedRequest.url, validatedRequest.headers);
      
      case 'api_post':
        return await this.apiClient.post(
          validatedRequest.url,
          validatedRequest.body,
          validatedRequest.headers
        );
      
      case 'api_put':
        return await this.apiClient.put(
          validatedRequest.url,
          validatedRequest.body,
          validatedRequest.headers
        );
      
      case 'api_delete':
        return await this.apiClient.delete(validatedRequest.url, validatedRequest.headers);
      
      default:
        return {
          error: {
            type: 'validation' as const,
            message: `Unsupported tool: ${toolName}`,
          },
        };
    }
  • Executes the HTTP GET request using axios instance, implementing the core logic of the 'api_get' tool.
    async get(url: string, headers?: Record<string, string>): Promise<APIResponse | ErrorResponse> {
      return this.makeRequest({
        url,
        method: 'GET',
        headers,
      });
    }
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 of behavioral disclosure. It states the action but lacks critical details: it doesn't mention authentication requirements, rate limits, error handling, response formats, or idempotency. For a general-purpose HTTP tool, this leaves significant behavioral gaps.

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 that directly states the tool's function without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 an HTTP GET tool with no annotations and no output schema, the description is incomplete. It doesn't address key contextual aspects like expected response types, error scenarios, or integration with sibling tools, leaving the agent with insufficient information for reliable use.

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%, with the schema fully documenting both parameters (url and headers). The description adds no additional parameter semantics beyond what the schema provides, such as example headers or URL constraints. 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 action ('Make an HTTP GET request') and the target ('to the specified URL'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools (api_delete, api_post, api_put) beyond the HTTP method, missing explicit distinction about when to use GET versus other methods.

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. It doesn't mention typical use cases for GET requests (e.g., retrieving data, idempotent operations) or contrast with siblings for different HTTP methods, leaving the agent without contextual usage instructions.

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/fikri2992/mcp0'

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