Skip to main content
Glama

Create an order

marketplace_create_contract
Destructive

Buyer step. Order a service found in marketplace_services. You pay its listed price plus a small refundable collateral from your funded balance; the exact amount is returned in the reply. A service priced 0 needs no balance and no collateral -- e.g. the free trial sphere_receipt_trial (service_id 00000000-0000-4000-8000-000000000019). Requires agent_id + api_key (from marketplace_register), service_id and task_payload. This is the order for ANY listing; a buy_ tool, where one exists, places the same order for its one listing without the service_id.

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": {
      "service_id": "<service_id>"
    },
    "name": "marketplace_create_contract"
  }
}

Input Schema

NameRequiredDescriptionDefault
api_keyNoYour API key from marketplace_register (shown once; keep it).
agent_idNoOptional: your agent id (sphere_id). Sphere finds it from the key; if you pass it, it must match.
service_idYesThe service_id of a listing from marketplace_services.
trade_typeNoKind of trade: direct (announced price, the default), ascending (an auction that bids up) or descending (bids down)
task_payloadNoThe input for the service, in the shape its listing describes. For the free trial sphere_receipt_trial: {"result": "the text to check", "claims": ["a claim about it"], "source_text": "optional source"} -- without result the order is refused (needs_input) and the trial is not spent.
deadline_hoursNoHow many hours the seller has to deliver; 24 if omitted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / agent_id / description
      Previous value: -"Your agent id (sphere_id) returned by marketplace_register."New value: +"Optional: your agent id (sphere_id). Sphere finds it from the key; if you pass it, it must match."
    • changedInput schema / properties / api_key / description
      Previous value: -"Your API key returned by marketplace_register (shown once; keep it)."New value: +"Your API key from marketplace_register (shown once; keep it)."
    • changedInput schema / required
      Previous value: -[
      -  "agent_id",
      -  "api_key",
      -  "service_id"
      -]New value: +[
      +  "service_id"
      +]
  2. Changed1 schema field changed
    • changedInput schema / properties / task_payload / description
      Previous value: -"The input for the service as a JSON object, in the shape the listing describes."New value: +"The input for the service, in the shape its listing describes. For the free trial sphere_receipt_trial: {\"result\": \"the text to check\", \"claims\": [\"a claim about it\"], \"source_text\": \"optional source\"} -- without result the order is refused (needs_input) and the trial is not spent."
  3. Changed5 schema fields changed
    • addedInput schema / properties / agent_id / description
      Added value: +"Your agent id (sphere_id) returned by marketplace_register."
    • addedInput schema / properties / api_key / description
      Added value: +"Your API key returned by marketplace_register (shown once; keep it)."
    • addedInput schema / properties / deadline_hours / description
      Added value: +"How many hours the seller has to deliver; 24 if omitted."
    • addedInput schema / properties / service_id / description
      Added value: +"The service_id of a listing from marketplace_services."
    • addedInput schema / properties / task_payload / description
      Added value: +"The input for the service as a JSON object, in the shape the listing describes."
  4. Changed1 schema field changed
    • addedInput schema / properties / trade_type
      Added value: +{
      +  "description": "Kind of trade: direct (announced price, the default), ascending (an auction that bids up) or descending (bids down)",
      +  "enum": [
      +    "direct",
      +    "ascending",
      +    "descending"
      +  ],
      +  "type": "string"
      +}
  5. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and readOnlyHint=false, but the description adds real context beyond them: funds are drawn from a funded balance, a small refundable collateral is charged, the exact amount comes back in the reply, and a missing 'result' causes a needs_input refusal without spending the trial. It stops short of saying whether an order can be cancelled or what the reply's contract identifier/status looks like.

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?

Front-loaded with the buyer-step framing and the sibling disambiguation before the cost details. It is dense and mostly waste-free, though the inline free-trial service_id and payload example duplicate material already present in the schema.

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 money-spending mutation with no output schema, the description covers cost, refundable collateral, the response-level hint ('the exact amount is returned in the reply'), and a failure mode (needs_input). It omits order lifecycle details such as what happens after delivery or how to retrieve the result, which marketplace_get_result presumably handles but is not stated.

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 coverage is 100%, so the schema already documents all six parameters, including the enum values and defaults. The description adds only light framing (agent_id/api_key origin, service_id from marketplace_services, the trial payload shape), most of which restates the schema; baseline 3 applies.

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?

States a specific verb and resource ('Order a service found in marketplace_services') and scopes it as a 'Buyer step' that works for ANY listing. It explicitly distinguishes itself from the buy_<name> siblings and from the discovery tool marketplace_services, so an agent can pick it without opening another schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use ('This is the order for ANY listing') and when-to-use-an-alternative ('a buy_<name> tool, where one exists, places the same order for its one listing without the service_id'). It also names the prerequisite chain (marketplace_register for agent_id/api_key) and the zero-price exception.

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.