Skip to main content
Glama

commerce_collect_orders

Aggregate order information from your e-commerce system to centralize processing and enable automated inventory management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ordersNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that executes the commerce_collect_orders tool logic. It initializes a database connection, validates incoming orders against StandardOrder model, saves them to the database, and returns the count and list of all stored orders.
    def collect_orders(
        *,
        orders: list[dict[str, object]] | None = None,
        db_path: Path | str,
    ) -> dict[str, object]:
        database = Database(db_path)
        database.bootstrap()
    
        if orders:
            normalized = [StandardOrder.model_validate(order) for order in orders]
            database.save_orders(normalized)
    
        stored_orders = database.list_orders()
        return {
            "count": len(stored_orders),
            "orders": stored_orders,
        }
  • Pydantic schema defining the StandardOrder model used for input validation in the collect_orders handler. Defines fields like id, channel, channel_order_id, product_id, buyer info, quantity, price, status, and timestamps.
    class StandardOrder(BaseModel):
        id: str = Field(default_factory=generate_order_id)
        channel: str
        channel_order_id: str
        product_id: str
        buyer_name: str
        buyer_phone: str | None = None
        address: str | None = None
        quantity: int = 1
        selling_price: int = 0
        status: str = "pending"
        invoice_number: str | None = None
        ordered_at: str = Field(default_factory=utc_now_iso)
        processed_at: str | None = None
  • core/server.py:58-60 (registration)
    Registration point where the commerce_collect_orders tool is registered with the FastMCP app using the @app.tool decorator. This exposes the tool to MCP clients.
    @app.tool(name="commerce_collect_orders")
    def commerce_collect_orders(orders: list[dict[str, object]] | None = None) -> dict[str, object]:
        return collect_orders(orders=orders, db_path=resolved_db_path)
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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?

Tool has no description.

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/sinmb79/Commerc-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server