Skip to main content
Glama

api_get

Initiate HTTP GET requests to any specified URL using the MCP API Server. Input a URL and optional headers to retrieve data from external APIs with precision and ease.

Instructions

Make an HTTP GET request to the specified URL

Input Schema

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

Implementation Reference

  • Defines the MCPTool metadata including name, description, and inputSchema for the api_get tool.
    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'], }, };
  • The APIClient.get() method implements the core execution logic for the api_get tool, creating and sending the HTTP GET request.
    async get(url: string, headers?: Record<string, string>): Promise<APIResponse | ErrorResponse> { return this.makeRequest({ url, method: 'GET', headers, }); }
  • Registers the MCP list_tools handler which returns all available tools including api_get.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { this.log('Received list_tools request'); return { tools: ALL_API_TOOLS, }; });
  • src/tools.ts:138-143 (registration)
    Creates a lookup map of tool names to MCPTool definitions, registering api_get for quick access during tool calls.
    export const TOOL_MAP: Record<string, MCPTool> = { [API_GET_TOOL.name]: API_GET_TOOL, [API_POST_TOOL.name]: API_POST_TOOL, [API_PUT_TOOL.name]: API_PUT_TOOL, [API_DELETE_TOOL.name]: API_DELETE_TOOL, };
  • Dispatches api_get tool calls to the APIClient.get() handler in the MCP server's handleToolCall method.
    case 'api_get': return await this.apiClient.get(validatedRequest.url, validatedRequest.headers);

Other Tools

Related 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