delete_post
Remove a specific post from Google Maps MCP Server by providing its unique ID. This action ensures the post is deleted permanently from the system.
Instructions
Deletes a post by ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the post to delete. |
Implementation Reference
- src/index.ts:133-152 (handler)The main handler function that executes the delete_post tool logic: finds the post by ID in the in-memory array, removes it if found, and returns appropriate success/error response.async function handleDeletePost(id: string) { console.error(`Handling delete_post request for ID: ${id}`); const initialLength = posts.length; const postIndex = posts.findIndex(post => post.id === id); if (postIndex === -1) { return { content: [{ type: "text", text: `Error: No post found with ID: ${id}` }], isError: true, }; } posts.splice(postIndex, 1); return { content: [{ type: "text", text: `Success! Post with ID: ${id} deleted.` }], isError: false, }; }
- src/index.ts:62-75 (schema)Defines the Tool schema for 'delete_post', including name, description, and input schema that requires a string 'id'.const DELETE_POST_TOOL: Tool = { name: "delete_post", description: "Deletes a post by ID.", inputSchema: { type: "object", properties: { id: { type: "string", description: "The ID of the post to delete.", }, }, required: ["id"], }, };
- src/index.ts:77-82 (registration)Registers the delete_post tool by including DELETE_POST_TOOL in the SIMPLE_TOOLS array, which is returned in response to ListTools requests.const SIMPLE_TOOLS = [ GET_WEATHER_TOOL, ADD_POST_TOOL, GET_POSTS_TOOL, DELETE_POST_TOOL, ] as const;
- src/index.ts:195-198 (registration)Registers the handler for delete_post in the CallToolRequest switch statement by dispatching to handleDeletePost.case "delete_post": { const { id } = request.params.arguments as { id: string }; return await handleDeletePost(id); }