Skip to main content
Glama
paracetamol951

caisse-enregistreuse-mcp-server

Retourne l’ensemble des réductions ou suppléments disponibles dans la boutique, incluant leur nom, type (pourcentage ou fixe), valeur et conditions d’application.

data_list_discounts
Read-only

Retrieve available discounts from a sales recorder system in JSON, CSV, or HTML format for integration and reporting purposes.

Instructions

Liste des Lister les réductions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNojson

Implementation Reference

  • The handler function registered for the 'data_list_discounts' tool (shared via registerSimple). It resolves authentication, performs an HTTP GET to '/workers/getDiscounts.php' with shop credentials and format, structures the data response, and handles errors.
        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,
                };
            }
        }
    );
  • Common input schema used for 'data_list_discounts' tool, defining the optional 'format' parameter.
        format: z.enum(['json', 'csv', 'html']).default('json'),
    } satisfies Record<string, ZodTypeAny>;
  • Registration of the 'data_list_discounts' tool using the generic registerSimple helper, specifying the PHP endpoint and i18n labels.
    registerSimple(server, 'data_list_discounts', '/workers/getDiscounts.php', t('tools.data_list_discounts.description'), t('tools.data_list_discounts.title'));
  • The registerSimple helper function that defines the generic handler, schema, and registration logic used for 'data_list_discounts' and other list tools.
    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,
                    };
                }
            }
        );
    }
Behavior3/5

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

The description adds no behavioral information beyond what annotations provide. The annotation readOnlyHint=true already indicates this is a safe read operation. The description doesn't disclose any additional behavioral traits like rate limits, authentication needs, or what specific data is returned. However, it doesn't contradict the annotations, so it meets the minimum baseline when annotations cover the safety profile.

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 is extremely brief ('Liste des Lister les réductions') but this brevity comes from under-specification rather than efficient communication. It's not front-loaded with useful information and contains grammatical redundancy. While short, it fails to convey meaningful content, making it inefficient rather than 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 purpose (listing discounts with details like name, type, value, and conditions as stated in the title), the description is incomplete. It doesn't explain what data is returned, how results are structured, or any limitations. With no output schema and minimal description, an agent would struggle to understand how to use this tool effectively beyond the basic purpose indicated in the title.

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 description provides no information about parameters. However, with only one parameter (format) that has 100% schema coverage (enum values and default are fully documented in the schema), the baseline score is 3. The description doesn't need to compensate since the schema adequately documents the single parameter.

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 réductions' is essentially a tautology that restates the tool name 'data_list_discounts' in French with grammatical errors ('Lister les réductions' means 'List the discounts'). While the title provides a clear purpose ('Retourne l'ensemble des réductions ou suppléments disponibles...'), the description itself adds no meaningful clarification beyond what's already in the name/title, making it minimally useful.

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. It doesn't mention any of the sibling tools (e.g., data_list_products, data_list_orders) or explain how this tool differs from them. There's no context about when this tool is appropriate or when other tools might be better suited.

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