api_delete
Remove resources from external APIs by sending HTTP DELETE requests through the MCP API Server. Specify the target URL and optional headers to delete data programmatically.
Instructions
Make an HTTP DELETE request to the specified URL
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URL to make the DELETE request to | |
| headers | No | Optional headers to include in the request |
Implementation Reference
- src/tools.ts:102-123 (schema)Defines the MCPTool specification for 'api_delete' including name, description, and input schema for URL and optional headers.export const API_DELETE_TOOL: MCPTool = { name: 'api_delete', description: 'Make an HTTP DELETE request to the specified URL', inputSchema: { type: 'object', properties: { url: { type: 'string', format: 'uri', description: 'The URL to make the DELETE request to', }, headers: { type: 'object', description: 'Optional headers to include in the request', additionalProperties: { type: 'string', }, }, }, required: ['url'], }, };
- src/tools.ts:138-142 (registration)Registers 'api_delete' in the TOOL_MAP lookup used by mcp-server to validate tool existence.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:85-90 (registration)Registers the MCP list_tools handler which exposes api_delete (via ALL_API_TOOLS) to clients.this.server.setRequestHandler(ListToolsRequestSchema, async () => { this.log('Received list_tools request'); return { tools: ALL_API_TOOLS, }; });
- src/mcp-server.ts:217-218 (handler)The dispatch handler in handleToolCall that executes api_delete by calling apiClient.delete.case 'api_delete': return await this.apiClient.delete(validatedRequest.url, validatedRequest.headers);
- src/api-client.ts:107-113 (handler)Core implementation of the DELETE request using axios makeRequest method.async delete(url: string, headers?: Record<string, string>): Promise<APIResponse | ErrorResponse> { return this.makeRequest({ url, method: 'DELETE', headers, }); }