Skip to main content
Glama
paracetamol951

caisse-enregistreuse-mcp-server

Récupère la liste des groupes de rayons, utilisés pour organiser les catégories de produits. Chaque groupe peut regrouper plusieurs rayons.

data_list_department_groups
Read-only

Retrieve department groups from a sales recorder system in JSON, CSV, or HTML format to organize retail categories.

Instructions

Liste des Lister les groupes de rayons

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNojson

Implementation Reference

  • The handler function for the tool (shared with other simple list tools). It resolves authentication, fetches data from the specific PHP endpoint using the 'get' HTTP client with shopId, apiKey, and format params, logs the result, structures the data, and returns it or an error message.
    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 used for the tool: optional 'format' parameter defaulting to 'json'.
    const CommonShape = {
        format: z.enum(['json', 'csv', 'html']).default('json'),
    } satisfies Record<string, ZodTypeAny>;
  • Specific registration of the 'data_list_department_groups' tool using the registerSimple helper, specifying the PHP endpoint '/workers/getDepartmentsGroups.php'.
    registerSimple(server, 'data_list_department_groups', '/workers/getDepartmentsGroups.php', t('tools.data_list_department_groups.description'), t('tools.data_list_department_groups.title'));
  • registerSimple helper function that performs the server.registerTool call, defining title, description, inputSchema, and the generic handler for 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,
                    };
                }
            }
        );
    }
  • Helper function used in the handler to format the response with a text preview and structuredContent.
    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?

The annotations provide readOnlyHint=true, which tells the agent this is a safe read operation. The description adds no behavioral context beyond what the annotations already provide - no information about rate limits, authentication needs, response format, or other behavioral characteristics. However, it doesn't contradict the annotations, so it gets a baseline score.

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 groupes de rayons' is grammatically awkward and appears to be a translation error or duplication ('Liste des' followed by 'Lister les'). It's extremely brief but not effectively concise - it's under-specified rather than efficiently informative. The phrasing doesn't earn its place as a helpful description.

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?

For a read-only listing tool with no output schema, the description is inadequate. It doesn't explain what information is returned, how results are structured, whether there's pagination, or any other contextual details needed to use the tool effectively. The title provides more useful information than the description itself.

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?

With 0% schema description coverage for the single parameter 'format', the description carries full burden for explaining parameters but provides none. However, the parameter has an enum with clear options (json, csv, html) and a default value, making it self-explanatory. The baseline score of 3 reflects that while the description adds no parameter information, the schema itself is sufficiently clear.

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 groupes de rayons' is tautological - it essentially restates the tool name 'data_list_department_groups' in French. While the title provides context about retrieving groups used to organize product categories, the description itself adds no meaningful clarification about what the tool actually does beyond repeating 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?

The description provides no guidance on when to use this tool versus alternatives. Given there are 14 sibling tools including 'data_list_departments' which might be related, there's no indication of how this tool differs or when it should be preferred over other listing tools. The description offers no contextual usage information.

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