Skip to main content
Glama
Moe03

Google Maps MCP Server

by Moe03

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
NameRequiredDescriptionDefault
idYesThe ID of the post to delete.

Implementation Reference

  • 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, }; }
  • 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); }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Moe03/mcp-hello-world'

If you have feedback or need assistance with the MCP directory API, please join our Discord server