Skip to main content
Glama
fikri2992

MCP API Server

by fikri2992

api_put

Update or replace existing resources by sending HTTP PUT requests to specified URLs with custom headers and request bodies.

Instructions

Make an HTTP PUT request to the specified URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to make the PUT request to
bodyNoThe request body (string or JSON object)
headersNoOptional headers to include in the request

Implementation Reference

  • Core handler function that executes the HTTP PUT request by calling the shared makeRequest method with method: 'PUT'.
    async put(
      url: string,
      body?: string | object,
      headers?: Record<string, string>
    ): Promise<APIResponse | ErrorResponse> {
      return this.makeRequest({
        url,
        method: 'PUT',
        body,
        headers,
      });
    }
  • MCPTool schema definition for the api_put tool, including inputSchema for validation.
    export const API_PUT_TOOL: MCPTool = {
      name: 'api_put',
      description: 'Make an HTTP PUT request to the specified URL',
      inputSchema: {
        type: 'object',
        properties: {
          url: {
            type: 'string',
            format: 'uri',
            description: 'The URL to make the PUT request to',
          },
          body: {
            oneOf: [
              { type: 'string' },
              { type: 'object' },
            ],
            description: 'The request body (string or JSON object)',
          },
          headers: {
            type: 'object',
            description: 'Optional headers to include in the request',
            additionalProperties: {
              type: 'string',
            },
          },
        },
        required: ['url'],
      },
    };
  • src/tools.ts:138-143 (registration)
    Registration of api_put tool in the TOOL_MAP used for quick lookup and validation in MCP server.
    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,
    };
  • Dispatch handler in MCPServer.handleToolCall that routes api_put calls to APIClient.put().
    case 'api_put':
      return await this.apiClient.put(
        validatedRequest.url,
        validatedRequest.body,
        validatedRequest.headers
      );
  • Zod schema for validating PUT tool parameters used in request validation.
    export const PutToolParamsSchema = BaseToolParamsSchema.extend({
      body: BodySchema,
    });
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 states the action but does not cover critical traits like authentication requirements, rate limits, error handling, or whether the operation is idempotent (a key aspect of PUT). This leaves significant gaps for an agent to understand how to use the tool safely and effectively.

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, direct sentence with zero waste, clearly front-loading the purpose. It is appropriately sized for the tool's scope, making it efficient and easy to parse.

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 tool's complexity (HTTP PUT with potential side effects), lack of annotations, and no output schema, the description is incomplete. It fails to address behavioral aspects like idempotency, error responses, or typical usage patterns, leaving the agent with insufficient context for reliable invocation.

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 input schema already documents all parameters (url, body, headers) with descriptions. The description adds no additional meaning beyond what the schema provides, such as examples or constraints, but does not contradict it. Baseline score of 3 is appropriate as the schema handles 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 ('Make an HTTP PUT request') and the resource ('to the specified URL'), distinguishing it from siblings like api_get or api_post by specifying the HTTP method. However, it does not explicitly differentiate from api_delete, which also targets a URL, making it slightly less specific than a perfect score.

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 such as api_post or api_delete, nor does it mention prerequisites like authentication or typical use cases for PUT requests (e.g., updating resources). It lacks explicit when/when-not instructions or context for selection among siblings.

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