Skip to main content
Glama
paracetamol951

caisse-enregistreuse-mcp-server

Retourne la liste des moyens de paiement configurés dans la boutique (espèces, carte bancaire, paiement mobile, etc.).

data_list_payments_modes
Read-only

Retrieve available payment methods from a sales recorder system. Supports JSON, CSV, or HTML formats for integration with POS and cash register applications.

Instructions

Liste des Lister les modes de paiement

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNojson

Implementation Reference

  • Handler function that authenticates with the shop, fetches payment modes data from '/workers/getPaymentModes.php' using the HTTP 'get' utility, logs the result, structures the response using 'structData', and 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,
            };
        }
  • Shared input schema used by the tool for parameter validation, supporting 'json', 'csv', or 'html' output formats.
    const CommonShape = {
        format: z.enum(['json', 'csv', 'html']).default('json'),
    } satisfies Record<string, ZodTypeAny>;
  • Registers the MCP tool 'data_list_payments_modes' by calling the 'registerSimple' helper, specifying the backend PHP endpoint and localized title/description.
    registerSimple(server, 'data_list_payments_modes', '/workers/getPaymentModes.php', t('tools.data_list_payments.description'), t('tools.data_list_payments.title'));
  • Utility function called by the handler to prepare the tool response, creating a text preview and structured content for MCP compliance.
    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 doesn't contradict as it implies a listing operation. However, the description adds no behavioral context beyond what annotations provide, such as rate limits, authentication needs, or output behavior. Since annotations cover the safety profile, the baseline is met, but no extra value is added.

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 modes de paiement' is poorly structured and redundant, with 'Liste des' and 'Lister' repeating similar concepts. It's not front-loaded with key information and wastes space without adding clarity. A single, clear sentence would be more effective, but this version is both brief and unhelpful.

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 (1 parameter, read-only, no output schema), the description is incomplete. It fails to explain what 'modes de paiement' includes or how the output might be structured, relying solely on annotations and schema. For a list tool with sibling tools, more context is needed to differentiate and guide usage 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?

Schema description coverage is 0%, but the description provides no parameter information. The input schema defines a 'format' parameter with enum values (json, csv, html) and a default, which is self-explanatory. With 1 parameter and no description coverage, the baseline is 3 as the schema handles the documentation adequately, but the description doesn't compensate for the lack of coverage.

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 modes de paiement' is tautological, essentially restating the tool name 'data_list_payments_modes' in French. While it hints at listing payment methods, it lacks specificity about what 'modes de paiement' entails and doesn't distinguish this tool from other list tools like data_list_cashboxes or data_list_orders. The title provides more clarity by mentioning examples like cash and credit cards, but the description itself is redundant.

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. It doesn't mention any prerequisites, context for usage, or comparisons to sibling tools such as data_list_orders or sale_create. The description is too vague to imply any specific usage scenarios, leaving the agent without direction on application.

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