Skip to main content
Glama

mcp_http_request

Send HTTP requests (GET, POST, PUT, DELETE, PATCH) with customizable headers, body data, and URL parameters. Retrieve responses for seamless integration with Ontology MCP server workflows.

Instructions

HTTP 요청을 보내고 응답을 반환합니다. GET, POST, PUT, DELETE 등 다양한 HTTP 메소드를 사용할 수 있으며, 헤더와 데이터를 설정할 수 있습니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo요청 바디 데이터
headersNo요청 헤더 (예: {"Content-Type": "application/json", "Authorization": "Bearer token"})
methodNoHTTP 메소드 (기본값: GET)
paramsNoURL 파라미터 (예: ?key=value)
timeoutNo타임아웃(밀리초 단위, 기본값: 30000)
urlYes요청할 URL

Implementation Reference

  • MCP tool handler function for 'mcp_http_request' that invokes httpService.request and formats the response.
    async handler(args: any): Promise<ToolResponse> {
      try {
        const result = await httpService.request(args);
        return {
          content: [{
            type: 'text',
            text: result
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `HTTP 요청 오류: ${error instanceof Error ? error.message : String(error)}`
          }]
        };
      }
    }
  • Input schema definition for the mcp_http_request tool parameters.
    inputSchema: {
      type: 'object',
      properties: {
        url: {
          type: 'string',
          description: '요청할 URL'
        },
        method: {
          type: 'string',
          enum: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'],
          description: 'HTTP 메소드 (기본값: GET)'
        },
        headers: {
          type: 'object',
          description: '요청 헤더 (예: {"Content-Type": "application/json", "Authorization": "Bearer token"})'
        },
        data: {
          type: 'object',
          description: '요청 바디 데이터'
        },
        params: {
          type: 'object',
          description: 'URL 파라미터 (예: ?key=value)'
        },
        timeout: {
          type: 'number',
          description: '타임아웃(밀리초 단위, 기본값: 30000)'
        }
      },
      required: ['url']
    },
  • Core HTTP request implementation using axios, handling config, response formatting, and errors.
    async request(args: HttpRequestArgs): Promise<string> {
      try {
        const config: AxiosRequestConfig = {
          url: args.url,
          method: args.method || 'GET',
          timeout: args.timeout || 30000,
        };
    
        if (args.headers) {
          config.headers = args.headers;
        }
    
        if (args.params) {
          config.params = args.params;
        }
    
        if (args.data) {
          config.data = args.data;
        }
    
        const response = await axios(config);
        
        // 응답 데이터 처리
        let responseData = response.data;
        
        // 객체인 경우 JSON 문자열로 변환
        if (typeof responseData === 'object') {
          responseData = JSON.stringify(responseData, null, 2);
        }
        
        return responseData;
      } catch (error) {
        if (axios.isAxiosError(error)) {
          const statusCode = error.response?.status;
          const responseData = error.response?.data;
          
          throw new McpError(
            ErrorCode.InternalError,
            `HTTP 요청 오류 (${statusCode}): ${
              typeof responseData === 'object' 
                ? JSON.stringify(responseData, null, 2) 
                : responseData || error.message
            }`
          );
        }
        
        throw new McpError(
          ErrorCode.InternalError,
          `HTTP 요청 실패: ${formatError(error)}`
        );
      }
  • Tool object definition and registration in the tools export array used by the MCP server.
    {
      name: 'mcp_http_request',
      description: 'HTTP 요청을 보내고 응답을 반환합니다. GET, POST, PUT, DELETE 등 다양한 HTTP 메소드를 사용할 수 있으며, 헤더와 데이터를 설정할 수 있습니다.',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            description: '요청할 URL'
          },
          method: {
            type: 'string',
            enum: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'],
            description: 'HTTP 메소드 (기본값: GET)'
          },
          headers: {
            type: 'object',
            description: '요청 헤더 (예: {"Content-Type": "application/json", "Authorization": "Bearer token"})'
          },
          data: {
            type: 'object',
            description: '요청 바디 데이터'
          },
          params: {
            type: 'object',
            description: 'URL 파라미터 (예: ?key=value)'
          },
          timeout: {
            type: 'number',
            description: '타임아웃(밀리초 단위, 기본값: 30000)'
          }
        },
        required: ['url']
      },
      async handler(args: any): Promise<ToolResponse> {
        try {
          const result = await httpService.request(args);
          return {
            content: [{
              type: 'text',
              text: result
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: 'text',
              text: `HTTP 요청 오류: ${error instanceof Error ? error.message : String(error)}`
            }]
          };
        }
      }
    },
  • src/index.ts:24-53 (registration)
    MCP server capabilities registration declaring support for mcp_http_request tool.
    capabilities: {
      tools: {
        mcp_sparql_execute_query: true,
        mcp_sparql_update: true,
        mcp_sparql_list_repositories: true,
        mcp_sparql_list_graphs: true,
        mcp_sparql_get_resource_info: true,
        mcp_ollama_run: true,
        mcp_ollama_show: true,
        mcp_ollama_pull: true,
        mcp_ollama_list: true,
        mcp_ollama_rm: true,
        mcp_ollama_chat_completion: true,
        mcp_ollama_status: true,
        mcp_http_request: true,
        mcp_openai_chat: true,
        mcp_openai_image: true,
        mcp_openai_tts: true,
        mcp_openai_transcribe: true,
        mcp_openai_embedding: true,
        mcp_gemini_generate_text: true,
        mcp_gemini_chat_completion: true,
        mcp_gemini_list_models: true,
        mcp_gemini_generate_images: false,
        mcp_gemini_generate_image: false,
        mcp_gemini_generate_videos: false,
        mcp_gemini_generate_multimodal_content: false,
        mcp_imagen_generate: false,
        mcp_gemini_create_image: false,
        mcp_gemini_edit_image: false
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 mentions what the tool can do (send requests with various methods/headers/data) but doesn't describe error handling, rate limits, timeout behavior beyond the parameter, authentication needs, or what the response format looks like. This is inadequate for a general-purpose HTTP tool.

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

Conciseness4/5

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

The description is efficiently structured in two sentences that cover the core functionality. However, it could be more front-loaded by explicitly stating it's a general-purpose HTTP client tool. No wasted words, but slightly lacks optimal structure.

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?

For a complex, general-purpose HTTP tool with 6 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain response formats, error conditions, authentication requirements, or practical usage scenarios. The agent would struggle to use this effectively without trial and error.

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 already documents all 6 parameters thoroughly. The description adds minimal value by mentioning HTTP methods, headers, and data in general terms but provides no additional syntax, format details, or constraints beyond what's in the schema descriptions. Baseline 3 is appropriate.

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

Purpose5/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 with specific verbs ('send HTTP request' and 'return response') and resources (HTTP methods, headers, data). It distinguishes itself from sibling tools by focusing on general HTTP operations rather than specific API integrations like Gemini or OpenAI.

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 prerequisites like network access, authentication requirements, or when to choose this over more specialized sibling tools (e.g., mcp_openai_chat for OpenAI API calls).

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

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/bigdata-coss/agent_mcp'

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