Skip to main content
Glama

commerce_collect_cs

Collect customer service tickets to centralize support requests and streamline issue resolution workflows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ticketsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler function `collect_cs` that executes the commerce_collect_cs tool logic - normalizes incoming CS tickets, classifies messages, and stores them in the database
    def collect_cs(
        *,
        tickets: list[dict[str, object]] | None = None,
        db_path: Path | str,
    ) -> dict[str, object]:
        database = Database(db_path)
        database.bootstrap()
    
        if tickets:
            normalized = []
            for ticket in tickets:
                category = _classify_message(str(ticket["message"]))
                normalized.append(
                    CSTicket(
                        channel=str(ticket["channel"]),
                        order_id=ticket.get("order_id"),
                        type=category,
                        message=str(ticket["message"]),
                        ai_category=category,
                    )
                )
            database.save_cs_tickets(normalized)
    
        stored = database.list_cs_tickets()
        return {
            "count": len(stored),
            "tickets": stored,
        }
  • CSTicket Pydantic model defining the schema for customer service tickets with fields for channel, order_id, type, message, ai_category, ai_draft_response, status, and timestamps
    class CSTicket(BaseModel):
        id: str = Field(default_factory=generate_cs_ticket_id)
        channel: str
        order_id: str | None = None
        type: str = "inquiry"
        message: str
        ai_category: str | None = None
        ai_draft_response: str | None = None
        status: str = "open"
        created_at: str = Field(default_factory=utc_now_iso)
  • core/server.py:78-80 (registration)
    Tool registration for 'commerce_collect_cs' using FastMCP decorator, exposing the tool to MCP clients with the tickets parameter
    @app.tool(name="commerce_collect_cs")
    def commerce_collect_cs(tickets: list[dict[str, object]] | None = None) -> dict[str, object]:
        return collect_cs(tickets=tickets, db_path=resolved_db_path)
  • Helper function `_classify_message` that classifies CS messages into categories (exchange, return, complaint, inquiry) based on keyword matching in Korean and English
    def _classify_message(message: str) -> str:
        lowered = message.lower()
        if "교환" in message or "size" in lowered:
            return "exchange"
        if "반품" in message or "refund" in lowered:
            return "return"
        if "불량" in message or "불편" in message or "complaint" in lowered:
            return "complaint"
        return "inquiry"
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