Skip to main content
Glama
ronniemh
by ronniemh

delete-phrase

Remove a specific inspirational phrase from the Phrases MCP Server by providing its unique ID number.

Instructions

Deletes a phrase by its ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesPhrase ID to delete

Implementation Reference

  • src/index.ts:157-181 (registration)
    Registration of the 'delete-phrase' MCP tool, including description, input schema, and execution 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
                    }
                ]
            }
        }
    );
  • Handler function that executes the delete-phrase tool: calls mock API DELETE, formats success/failure message.
    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
                }
            ]
        }
    }
  • Zod input schema for the tool requiring a positive integer Phrase ID.
    {
        id: z.number().min(0).describe("Phrase ID to delete")
    },
  • Shared helper function that performs the actual HTTP DELETE request to the mock API, used by the delete-phrase handler.
    export async function makeMockAPIRequest<T>(
        method: HTTPMethod,
        options: RequestOptions = {}
    ): Promise<T | null> {
        const { path, queryParams, body } = options;
        let url = BASE_URL;
    
        if (path) url += path;
        if (method === "GET" && queryParams) {
            const query = new URLSearchParams(queryParams).toString();
            url += `?${query}`;
        }
    
        const headers: HeadersInit = {
            "Content-Type": "application/json",
        };
    
        const fetchOptions: RequestInit = {
            method,
            headers,
            body: body && method !== "GET" && method !== "DELETE"
                ? JSON.stringify(body)
                : undefined,
        };
    
        try {
            const response = await fetch(url, fetchOptions);
            if (!response.ok) throw new Error(`HTTP error: ${response.status}`);
            if (method === "DELETE" || response.status === 204) return null;
            return await response.json();
        } catch (err) {
            console.error(`Error on ${method} ${url}:`, err);
            return null;
        }
    }
  • TypeScript type definition for DeletePhraseParams.
    export type DeletePhraseParams = { id: number };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Deletes' which implies a destructive, irreversible mutation, but doesn't specify permissions required, side effects (e.g., if deletion cascades to related data), error handling, or confirmation steps. For a destructive tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse. Every word earns its place, achieving optimal conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a destructive mutation tool with no annotations and no output schema, the description is incomplete. It lacks critical context: what happens upon deletion (e.g., success response, error messages), any dependencies, or behavioral nuances. The agent is left guessing about the tool's full impact and results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'id' parameter fully documented as 'Phrase ID to delete'. The description adds no additional meaning beyond this, such as format examples or constraints not in the schema. With high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Deletes') and the resource ('a phrase by its ID'), making the purpose immediately understandable. It distinguishes itself from siblings like 'create-phrase' and 'update-phrase' by specifying deletion. However, it doesn't explicitly mention what 'phrase' refers to in the context, which could be slightly more specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing phrase ID), exclusions (e.g., not for bulk deletion), or comparisons to siblings like 'update-phrase' for modifications. This leaves the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/ronniemh/phrases-MCP-server'

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