Skip to main content
Glama
paracetamol951

caisse-enregistreuse-mcp-server

Récupère la liste des caisses enregistrées (physiques ou virtuelles) associées à la boutique, avec leurs identifiants et leur état actuel.

data_list_cashboxes
Read-only

Retrieve and list available cash registers from a POS system in JSON, CSV, or HTML format for inventory management and system integration.

Instructions

Liste des Lister les caisses

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNojson

Implementation Reference

  • Handler function that fetches cashbox data from '/workers/getCashbox.php' using authenticated shopId and apiKey, formats it, and returns structured content via structData. Handles errors gracefully.
    async ({ format }: CommonArgs, ctx: Ctx) => {
        try {
            const { shopId, apiKey } = resolveAuth(undefined, ctx);
            const data = await get(path, { idboutique: shopId, key: apiKey, format });
    
            process.stderr.write(
                `[caisse][tool:${toolName}] ok type=${Array.isArray(data) ? 'array' : typeof data}`
                + (Array.isArray(data) ? ` len=${data.length}` : '')
                + '\n'
            );
            //Array.isArray(data) ? data.slice(0, 50) : data
            const funcResult = structData( data);
            process.stderr.write(`[caisse][RES]  ${JSON.stringify(data)} \n`);
            process.stderr.write(`[caisse][RES] funcResult ${JSON.stringify(funcResult)} \n`);
            return funcResult;
            //return { content, structuredContent: isText ? undefined : data };
        } catch (e) {
            process.stderr.write(`[caisse][tool:${toolName}][error]\n`);
            process.stderr.write(`[caisse][tool:${toolName}][error] ${(e as Error).message}\n`);
            // renvoyer un message "propre" plutôt que laisser l’exception devenir un 424
            return {
                content: [{ type: 'text', text: `Erreur pendant la préparation de la réponse: ${(e as Error).message}` }],
                is_error: true,
            };
        }
  • Input schema for the tool: optional 'format' parameter with values 'json', 'csv', or 'html' (defaults to 'json').
    const CommonShape = {
        format: z.enum(['json', 'csv', 'html']).default('json'),
    } satisfies Record<string, ZodTypeAny>;
  • Registration of the 'data_list_cashboxes' tool within registerDataTools, using the shared registerSimple helper with specific endpoint and labels.
    registerSimple(server, 'data_list_cashboxes', '/workers/getCashbox.php', t('tools.data_list_cashboxes.description'), t('tools.data_list_cashboxes.title'));
  • Helper function registerSimple that creates and registers simple list tools, including schema, description template, and standard fetch handler.
    function registerSimple(
        server: McpServer | any,
        toolName: string,
        path: string,
        title: string,
        entityLabel: string
    ) {
        server.registerTool(
            toolName,
            {
                title,
                description: `Liste des ${entityLabel}`,
                inputSchema: CommonShape, // ZodRawShape,
                annotations: { readOnlyHint: true }
            },
            async ({ format }: CommonArgs, ctx: Ctx) => {
                try {
                    const { shopId, apiKey } = resolveAuth(undefined, ctx);
                    const data = await get(path, { idboutique: shopId, key: apiKey, format });
    
                    process.stderr.write(
                        `[caisse][tool:${toolName}] ok type=${Array.isArray(data) ? 'array' : typeof data}`
                        + (Array.isArray(data) ? ` len=${data.length}` : '')
                        + '\n'
                    );
                    //Array.isArray(data) ? data.slice(0, 50) : data
                    const funcResult = structData( data);
                    process.stderr.write(`[caisse][RES]  ${JSON.stringify(data)} \n`);
                    process.stderr.write(`[caisse][RES] funcResult ${JSON.stringify(funcResult)} \n`);
                    return funcResult;
                    //return { content, structuredContent: isText ? undefined : data };
                } catch (e) {
                    process.stderr.write(`[caisse][tool:${toolName}][error]\n`);
                    process.stderr.write(`[caisse][tool:${toolName}][error] ${(e as Error).message}\n`);
                    // renvoyer un message "propre" plutôt que laisser l’exception devenir un 424
                    return {
                        content: [{ type: 'text', text: `Erreur pendant la préparation de la réponse: ${(e as Error).message}` }],
                        is_error: true,
                    };
                }
            }
        );
    }
  • Helper function structData used by the handler to format the response with preview text and structured content.
    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,
        };
    }
Behavior3/5

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

Annotations indicate readOnlyHint=true, which the description does not contradict, as 'Liste' implies a read operation. However, the description adds no behavioral context beyond what annotations provide, such as rate limits, authentication needs, or response format details. With annotations covering safety, the description meets a minimal baseline but offers no extra value.

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

Conciseness2/5

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

The description 'Liste des Lister les caisses' is overly concise to the point of being nonsensical and grammatically flawed. It fails to front-load useful information and wastes space with redundancy, making it inefficient rather than appropriately concise.

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 low complexity, one parameter, and annotations, the description is incomplete. It lacks output schema, and the description does not compensate by explaining return values or usage context. While annotations help, the description itself is inadequate for guiding the agent effectively.

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 one parameter 'format' with enum values and 0% description coverage. The description provides no parameter information, but since schema coverage is low, the baseline is not fully met. However, with only one optional parameter and clear enum values in the schema, the description's lack of detail is partially mitigated, resulting in an average score.

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

Purpose2/5

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

The description 'Liste des Lister les caisses' is essentially a tautology that restates the tool name 'data_list_cashboxes' in French, providing no meaningful elaboration. While the title clarifies it retrieves registered cashboxes (physical or virtual) with their IDs and current status, the description itself adds no value and could be misleading due to its poor grammar and redundancy.

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

Usage Guidelines1/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. Given sibling tools like 'data_list_orders' or 'data_list_payments_modes', there is no indication of context, prerequisites, or distinctions, leaving the agent with no usage direction beyond the tool name.

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