delete_record
Remove a specific record from a resource by specifying its URI and record ID. Ideal for maintaining up-to-date and accurate data in your MCP Template server.
Instructions
Delete a record from a resource
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| recordId | Yes | ID of the record to delete | |
| resourceUri | Yes | URI of the resource |
Implementation Reference
- src/core/MCPServer.ts:231-237 (handler)Tool handler for 'delete_record' that validates arguments and calls dataService.deleteRecord, returning success status.case 'delete_record': { return await safeExecute(toolName, async () => { const args = validateInput(DeleteRecordArgsSchema, request.params.arguments); const success = await this.dataService.deleteRecord(args.resourceUri, args.recordId); return { success, id: args.recordId }; }); }
- src/types/index.ts:93-96 (schema)Zod input schema defining resourceUri and recordId for the delete_record tool.export const DeleteRecordArgsSchema = z.object({ resourceUri: z.string().describe('URI of the resource'), recordId: z.string().describe('ID of the record to delete'), });
- src/core/MCPServer.ts:158-162 (registration)Tool registration in handleListTools method, providing name, description, and input schema.{ name: 'delete_record', description: 'Delete a record from a resource', inputSchema: getInputSchema(DeleteRecordArgsSchema), },
- Core implementation of deleteRecord in InMemoryDataService, which deletes the record by ID from the in-memory Map.public async deleteRecord(uri: string, id: string): Promise<boolean> { this.validateResource(uri); const resourceData = this.data.get(uri)!; if (!resourceData.has(id)) { throw new Error(`Record not found: ${id}`); } return resourceData.delete(id); }