Skip to main content
Glama
ronniemh
by ronniemh

get-all-phrases

Retrieve all inspirational phrases with author details from the Phrases MCP Server for management and reference.

Instructions

Returns a list of all phrases.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the 'get-all-phrases' tool logic: fetches all phrases from the mock API, handles empty list, formats as 'phrase: "author"' list, and returns markdown-compatible text content.
    async () => {
        const phrases = await makeMockAPIRequest<Phrase[]>("GET");
        let resultText = "";
    
        if (!phrases || phrases.length === 0) {
            resultText = "No phrases found.";
        } else {
            const formatted = phrases.map(
                (p) => `${p.phrase}: "${p.name}"`
            ).join("\n");
            resultText = `Here are all the phrases:\n\n${formatted}`;
        }
    
        return {
            content: [
                {
                    type: "text",
                    text: resultText
                }
            ]
        }
    }
  • src/index.ts:17-43 (registration)
    The server.tool registration for 'get-all-phrases', including name, description, empty schema, and inline handler.
    server.tool(
        "get-all-phrases",
        "Returns a list of all phrases.",
        {},
        async () => {
            const phrases = await makeMockAPIRequest<Phrase[]>("GET");
            let resultText = "";
    
            if (!phrases || phrases.length === 0) {
                resultText = "No phrases found.";
            } else {
                const formatted = phrases.map(
                    (p) => `${p.phrase}: "${p.name}"`
                ).join("\n");
                resultText = `Here are all the phrases:\n\n${formatted}`;
            }
    
            return {
                content: [
                    {
                        type: "text",
                        text: resultText
                    }
                ]
            }
        }
    );
  • Empty Zod schema for input parameters (tool takes no arguments).
    {},
  • Supporting helper function that performs HTTP requests to the mock API. Used in handler as makeMockAPIRequest<Phrase[]>("GET") to retrieve all phrases.
    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;
        }
    }
  • Type definition for Phrase used in the generic type for fetching Phrase[].
    export interface Phrase {
        id: number;
        name: string;
        phrase: string;
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It only states the action of returning a list, without details on permissions, rate limits, pagination, or error handling. For a read operation with zero annotation coverage, this is insufficient to inform the agent about how the tool behaves beyond basic output.

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

Conciseness4/5

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

The description is a single sentence, 'Returns a list of all phrases,' which is efficient and front-loaded with the core action. It avoids unnecessary words, but could be slightly more informative (e.g., clarifying scope) without losing conciseness. Overall, it earns its place without waste.

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 the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimal but incomplete. It lacks context on what 'phrases' entail, how the list is structured, or any behavioral traits. For a tool with siblings offering filtered retrieval, more completeness is needed to guide effective use.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description does not add parameter details, which is appropriate here. A baseline of 4 is applied as it adequately handles the lack of parameters without introducing confusion or redundancy.

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

Purpose3/5

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

The description states the tool 'Returns a list of all phrases,' which clearly indicates its function as a retrieval operation. However, it lacks specificity about what 'phrases' are (e.g., linguistic phrases, database entries) and does not differentiate from sibling tools like 'get-phrase-by-id' or 'get-phrase-by-name,' making it vague in context. It avoids tautology by not merely restating the name.

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?

No guidance is provided on when to use this tool versus alternatives. The description does not mention scenarios like retrieving all phrases at once versus filtered lookups, prerequisites, or exclusions. With siblings like 'get-phrase-by-id' for specific queries, the lack of usage context leaves the agent without clear direction.

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