delete-phrase
Remove a specific phrase by its ID from the Phrases MCP Server to maintain an organized and up-to-date collection of inspirational quotes.
Instructions
Deletes a phrase by its ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Phrase ID to delete |
Implementation Reference
- src/index.ts:163-180 (handler)Handler function that sends a DELETE request to mock API to delete phrase by ID and returns appropriate text response.async ({id}) => { const result = await makeMockAPIRequest<null>("DELETE", { path: `/${id}`, }); const resultText = result === null ? `Phrase with ID ${id} was successfully deleted.` : `Failed to delete phrase with ID ${id}.`; return { content: [ { type: "text", text: resultText } ] } }
- src/index.ts:160-162 (schema)Zod schema for input parameter 'id' of the phrase to delete.{ id: z.number().min(0).describe("Phrase ID to delete") },
- src/index.ts:157-181 (registration)Registration of the 'delete-phrase' tool on the MCP server with name, description, schema, and handler.server.tool( "delete-phrase", "Deletes a phrase by its ID.", { id: z.number().min(0).describe("Phrase ID to delete") }, async ({id}) => { const result = await makeMockAPIRequest<null>("DELETE", { path: `/${id}`, }); const resultText = result === null ? `Phrase with ID ${id} was successfully deleted.` : `Failed to delete phrase with ID ${id}.`; return { content: [ { type: "text", text: resultText } ] } } );