Skip to main content
Glama

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, });

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