Skip to main content
Glama
paracetamol951

caisse-enregistreuse-mcp-server

Lister les commandes

data_list_orders
Read-only

Retrieve unvalidated quotes or validated orders/invoices within specified date ranges, with optional delivery method filtering for sales recorder systems.

Instructions

Listez soit les commandes non validées (les devis) dont la date de création est comprise entre from_date_ISO8601 et to_date_ISO8601, soit les commandes validées (dénommées commandes ou factures) dont la date de valeur est comprise entre from_date_ISO8601 et to_date_ISO8601. Vous pouvez également filtrer les modes de livraison (avec filterDeliveryMethod).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
validatedOrdersYes
from_date_ISO8601Yes
to_date_ISO8601Yes
filterDeliveryMethodNo

Implementation Reference

  • The core handler function for the 'data_list_orders' tool. It authenticates using resolveAuth, fetches order data via HTTP GET to '/workers/getOrders.php' with provided parameters, and returns structured data using structData.
    async ({ validatedOrders, from_date_ISO8601, to_date_ISO8601, filterDeliveryMethod }: getOrdersArgs, ctx: Ctx) => {
        const { shopId, apiKey } = resolveAuth(undefined, ctx);
        const data = await get('/workers/getOrders.php', { idboutique: shopId, key: apiKey, validatedOrders, from_date_ISO8601, to_date_ISO8601, filterDeliveryMethod });
    
        return structData(data);
        //return { content, structuredContent: isText ? undefined : data };
    }
  • Zod schema definition (getOrdersShape) and inferred TypeScript type (getOrdersArgs) for input parameters of the 'data_list_orders' tool.
    const getOrdersShape = {
        validatedOrders: z.boolean(),
        from_date_ISO8601: z.string().datetime(),
        to_date_ISO8601: z.string().datetime(),
        filterDeliveryMethod: z.union([
            z.number().int().min(0).max(6),
            z.enum(['0', '1', '2', '3', '4', '5', '6'])
        ]).transform((v) => Number(v)).optional(),
    } satisfies Record<string, ZodTypeAny>;
    
    type CommonArgs = InferFromShape<typeof CommonShape>;
    type getOrderArgs = InferFromShape<typeof getOrderShape>;
    type getOrdersArgs = InferFromShape<typeof getOrdersShape>;
  • Registration of the 'data_list_orders' tool on the MCP server, including schema reference and inline handler function.
    server.registerTool(
        'data_list_orders',
        {
            title: t('tools.data_list_orders.title'),
            description: t('tools.data_list_orders.description'),
            inputSchema: getOrdersShape, // ZodRawShape,
            annotations: { readOnlyHint: true }
        },
        async ({ validatedOrders, from_date_ISO8601, to_date_ISO8601, filterDeliveryMethod }: getOrdersArgs, ctx: Ctx) => {
            const { shopId, apiKey } = resolveAuth(undefined, ctx);
            const data = await get('/workers/getOrders.php', { idboutique: shopId, key: apiKey, validatedOrders, from_date_ISO8601, to_date_ISO8601, filterDeliveryMethod });
    
            return structData(data);
            //return { content, structuredContent: isText ? undefined : data };
        }
    );
  • Helper function 'structData' used by the handler to format the response with preview content and structured data, handling large arrays 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, and the description aligns with this by describing a listing operation. The description adds valuable behavioral context about the two distinct filtering modes (creation date for quotes vs value date for validated orders) and the optional delivery method filter, which goes beyond what annotations provide.

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 efficiently structured in two sentences that pack substantial information: first sentence explains the core functionality with date filtering logic, second adds optional filtering. Every word serves a purpose with zero redundancy.

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 read-only listing tool with no output schema, the description provides comprehensive context about what can be listed, filtering logic, and optional parameters. The main gap is lack of information about return format or pagination, but given the annotations and tool purpose, it's reasonably complete.

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?

With 0% schema description coverage, the description compensates well by explaining the semantics of validatedOrders parameter (distinguishing quotes from validated orders/invoices), date parameters (different date fields used based on order type), and filterDeliveryMethod (delivery mode filtering). It provides meaningful context beyond the bare schema.

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 'list' and resource 'orders', specifying two distinct types (unvalidated quotes vs validated orders/invoices) with different date filtering criteria. It distinguishes this tool from sibling tools like order_detail (detail view) and sale_create (creation).

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

Usage Guidelines4/5

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

The description provides clear context about when to use this tool: for listing orders/quotes within date ranges, with optional delivery method filtering. It doesn't explicitly mention when NOT to use it or name alternatives, but the context is sufficiently clear for proper usage.

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