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
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URL to make the PUT request to | |
| body | No | The request body (string or JSON object) | |
| headers | No | Optional headers to include in the request |
Implementation Reference
- src/api-client.ts:91-102 (handler)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, }); }
- src/tools.ts:69-97 (schema)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, };
- src/mcp-server.ts:210-215 (handler)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 );
- src/types.ts:178-180 (schema)Zod schema for validating PUT tool parameters used in request validation.export const PutToolParamsSchema = BaseToolParamsSchema.extend({ body: BodySchema, });