Skip to main content
Glama

Define collection

define_collection

Create or update a collection in the site database (e.g. contact form messages, products, bookings). See site_guide for using it from pages.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "site": "<site>",
      "name": "<name>",
      "fields": "<fields>"
    },
    "name": "define_collection"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
siteYesSite slug (e.g. "kopitiam-muar") or id
rulesNoinsert: public | visitor (signed in) | owner. read: public | visitor (any signed-in visitor) | own (each visitor sees only their own) | owner
fieldsYes
notifyNoEmail the owner on each new public submission
confirmNoSend the visitor a confirmation email. field = the email field; {field_name} placeholders are filled in, e.g. "Hi {name}, we got your booking for {date}."
paymentNoTake payment for each record (orders, deposits, tickets). Use k.pay() in the page. See site_guide "Taking payment".
whatsapp_alertNoAlso send the owner a WhatsApp alert for each new record (needs a linked Komers store)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false; the description adds the important upsert nuance ('create or update') that the annotations do not convey. It stops short of disclosing what happens to existing fields and records when an existing collection is redefined, which is the main risk an agent needs to know before calling it.

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

Conciseness4/5

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

Two short sentences with the core action front-loaded and no filler. The second sentence is a useful pointer rather than padding, though the whole definition is arguably under-specified for its complexity.

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

Completeness3/5

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

For an 8-parameter mutation tool with nested payment and confirmation objects and no output schema, the description covers purpose but omits permissions, return behavior, and update/replace semantics. The rich inline schema descriptions compensate substantially, keeping this at minimum-viable rather than deficient.

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 75% and the nested objects (rules, confirm, payment, whatsapp_alert) each carry their own inline explanations, so the schema does the heavy lifting. The description contributes no parameter-level meaning at all, making the baseline 3 appropriate.

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

Purpose4/5

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

States a specific verb and resource ('Create or update a collection in the site database') and grounds it with concrete examples (contact form messages, products, bookings). It does not, however, distinguish itself from nearby siblings such as delete_collection, add_record, or query_records, which an agent must infer.

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

Usage Guidelines3/5

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

Usage is only implied: the examples suggest schema definition precedes data entry, and 'See site_guide for using it from pages' hands off follow-up guidance to a sibling tool. There is no explicit when-to-use, when-not-to-use, or comparison against delete_collection/add_record.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources