Skip to main content
Glama
paracetamol951

caisse-enregistreuse-mcp-server

Obtenir le détail d'une commande

order_detail
Read-only

Retrieve complete order information including sold items, customer details, payment method, and total amount using the unique order identifier.

Instructions

Récupère toutes les informations d’une commande à partir de son identifiant unique, y compris les articles vendus, le client, le mode de paiement et le montant total.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_idYes

Implementation Reference

  • The handler function that implements the core logic of the 'order_detail' tool. It resolves shop authentication, makes an HTTP GET request to the PHP backend endpoint '/workers/getOrder.php' with the order_id, and returns the structured response using the shared structData helper.
    async ({ order_id }: getOrderArgs, ctx: Ctx) => {
        const { shopId, apiKey } = resolveAuth(undefined, ctx);
        const data = await get('/workers/getOrder.php', { idboutique: shopId, key: apiKey, order_id });
    
        return structData(data);
        //return { content, structuredContent: isText ? undefined : data };
    }
  • Zod input schema shape for the 'order_detail' tool, defining the required 'order_id' parameter as an integer.
    const getOrderShape = {
        order_id: z.number().int(),
    } satisfies Record<string, ZodTypeAny>;
  • The server.registerTool call that registers the 'order_detail' tool, including metadata (title, description from i18n), input schema reference, read-only annotation, and inline handler function.
    server.registerTool(
        'order_detail',
        {
            title: t('tools.order_detail.title'),
            description: t('tools.order_detail.description'),
            inputSchema: getOrderShape, // ZodRawShape,
            annotations: { readOnlyHint: true }
        },
        async ({ order_id }: getOrderArgs, ctx: Ctx) => {
            const { shopId, apiKey } = resolveAuth(undefined, ctx);
            const data = await get('/workers/getOrder.php', { idboutique: shopId, key: apiKey, order_id });
    
            return structData(data);
            //return { content, structuredContent: isText ? undefined : data };
        }
    );
  • TypeScript type definition for the input arguments of the order_detail handler, inferred from the Zod schema.
    type getOrderArgs = InferFromShape<typeof getOrderShape>;
  • Shared helper function used by order_detail (and other data tools) to format arbitrary data into MCP-standard response with text preview and structured content, handling truncation and serialization safely.
    function structData(data: any) {
        // on ne touche PAS à structuredContent (c’est ce que ChatGPT utilise)
        const light = Array.isArray(data)
            ? data.slice(0, 5000)//.map(({ id, nom, email, tel, ...r }) => ({ id, nom, email, tel }))
            : data;
    
        const maxLength = 40000;
        const preview =
            typeof light === 'string'
                ? (light.length > maxLength ? light.slice(0, maxLength) + '…(truncated)' : light)
                : safeStringify(light, 2, maxLength);   // <-- aperçu court et “safe”
        const wrapped =
            Array.isArray(data)
                ? { data: data }
                : data && typeof data === 'object'
                    ? data
                    : { data: data };
        return {
            content: [{ type: 'text', text: preview }],
            structuredContent: wrapped,
        };
    }
Behavior4/5

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

Annotations provide readOnlyHint=true, indicating a safe read operation. The description adds value by specifying the scope of information retrieved (items, customer, payment, total) and that it uses a unique order ID, which helps the agent understand what data to expect without contradicting annotations.

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, well-structured sentence that efficiently conveys purpose and scope without unnecessary details. It's front-loaded with the main action and includes all essential information concisely.

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

Completeness4/5

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

For a simple read tool with one parameter and readOnlyHint annotation, the description is complete enough. It explains what data is returned, though no output schema exists. However, it could improve by mentioning error cases or response format.

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?

Schema coverage is 0%, so the description carries full burden. It explains that 'order_id' is a unique identifier for retrieving order details, adding meaningful context beyond the schema's type definition. With only one parameter, this is sufficient for clarity.

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

Purpose5/5

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

The description clearly states the verb ('Récupère' - retrieves) and resource ('une commande' - an order), specifying it fetches all information including sold items, customer, payment method, and total amount. It distinguishes from sibling tools like 'data_list_orders' by focusing on a single order's details rather than listing multiple orders.

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

Usage Guidelines3/5

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

The description implies usage by mentioning retrieval from a unique identifier, but doesn't explicitly state when to use this vs. alternatives like 'data_list_orders' for listing orders or 'sale_create' for creating sales. No guidance on prerequisites or exclusions is provided.

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/paracetamol951/caisse-enregistreuse-mcp-server'

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