Skip to main content
Glama

cow_build_order

Build an unsigned CoW market order as EIP-712 typed data (eth_signTypedData_v4) plus the one-time vault-relayer approval tx if needed. No gas for the swap itself.

Input Schema

NameRequiredDescriptionDefault
chainYes
amountYes
senderYes0x wallet that signs
tokenInYes
tokenOutYes
recipientNo
slippageBpsNo

Output Schema

NameRequiredDescriptionDefault
feeYesDisclosed Quietwork fee (already reflected in expectedOut)
nextYes
noteNo
chainYes
orderYes
venueYes
minOutYes
senderNo
appDataNo
chainIdYes
quoteIdNo
tokenInYes
validToNo
amountInYes
approvalYesPresent for ERC-20 input tokens
receiverNo
tokenOutYes
verifiedNo
minOutWeiYes
typedDataYes
amountInWeiYes
appDataHashNo
expectedOutYes
slippageBpsNo
expectedOutWeiYes
protocolFeeBpsNo
networkCostInSellTokenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "amountIn": {
      +      "type": "string"
      +    },
      +    "amountInWei": {
      +      "type": "string"
      +    },
      +    "appData": {
      +      "type": "string"
      +    },
      +    "appDataHash": {
      +      "type": "string"
      +    },
      +    "approval": {
      +      "description": "Present for ERC-20 input tokens",
      +      "properties": {
      +        "amount": {
      +          "type": "string"
      +        },
      +        "note": {
      +          "type": "string"
      +        },
      +        "required_if_allowance_below": {
      +          "type": "string"
      +        },
      +        "spender": {
      +          "type": "string"
      +        },
      +        "token": {
      +          "type": "string"
      +        },
      +        "tx": {
      +          "properties": {
      +            "chainId": {
      +              "type": "integer"
      +            },
      +            "data": {
      +              "type": "string"
      +            },
      +            "from": {
      +              "type": "string"
      +            },
      +            "gas": {
      +              "type": "string"
      +            },
      +            "to": {
      +              "type": "string"
      +            },
      +            "value": {
      +              "description": "0x hex wei",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "chainId",
      +            "to",
      +            "data",
      +            "value",
      +            "from"
      +          ],
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "required_if_allowance_below",
      +        "token",
      +        "spender",
      +        "tx"
      +      ],
      +      "type": "object"
      +    },
      +    "chain": {
      +      "type": "string"
      +    },
      +    "chainId": {
      +      "type": "integer"
      +    },
      +    "expectedOut": {
      +      "type": "string"
      +    },
      +    "expectedOutWei": {
      +      "type": "string"
      +    },
      +    "fee": {
      +      "description": "Disclosed Quietwork fee (already reflected in expectedOut)",
      +      "properties": {
      +        "amountWei": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "bps": {
      +          "type": "number"
      +        },
      +        "note": {
      +          "type": "string"
      +        },
      +        "percent": {
      +          "type": "number"
      +        },
      +        "receiver": {
      +          "type": "string"
      +        },
      +        "takenFrom": {
      +          "type": "string"
      +        },
      +        "token": {
      +          "type": "string"
      +        },
      +        "venue": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "bps",
      +        "percent",
      +        "takenFrom",
      +        "receiver",
      +        "note"
      +      ],
      +      "type": "object"
      +    },
      +    "minOut": {
      +      "type": "string"
      +    },
      +    "minOutWei": {
      +      "type": "string"
      +    },
      +    "networkCostInSellToken": {
      +      "type": "string"
      +    },
      +    "next": {
      +      "type": "string"
      +    },
      +    "note": {
      +      "type": "string"
      +    },
      +    "order": {
      +      "properties": {
      +        "appData": {
      +          "type": "string"
      +        },
      +        "buyAmount": {
      +          "type": "string"
      +        },
      +        "buyToken": {
      +          "type": "string"
      +        },
      +        "buyTokenBalance": {
      +          "type": "string"
      +        },
      +        "feeAmount": {
      +          "type": "string"
      +        },
      +        "kind": {
      +          "type": "string"
      +        },
      +        "partiallyFillable": {
      +          "type": "boolean"
      +        },
      +        "receiver": {
      +          "type": "string"
      +        },
      +        "sellAmount": {
      +          "type": "string"
      +        },
      +        "sellToken": {
      +          "type": "string"
      +        },
      +        "sellTokenBalance": {
      +          "type": "string"
      +        },
      +        "validTo": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "sellToken",
      +        "buyToken",
      +        "receiver",
      +        "sellAmount",
      +        "buyAmount",
      +        "validTo",
      +        "appData",
      +        "feeAmount",
      +        "kind"
      +      ],
      +      "type": "object"
      +    },
      +    "protocolFeeBps": {
      +      "type": [
      +        "number",
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "quoteId": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "receiver": {
      +      "type": "string"
      +    },
      +    "sender": {
      +      "type": "string"
      +    },
      +    "slippageBps": {
      +      "type": "integer"
      +    },
      +    "tokenIn": {
      +      "properties": {
      +        "address": {
      +          "type": "string"
      +        },
      +        "decimals": {
      +          "type": "integer"
      +        },
      +        "symbol": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "address",
      +        "decimals",
      +        "symbol"
      +      ],
      +      "type": "object"
      +    },
      +    "tokenOut": {
      +      "properties": {
      +        "address": {
      +          "type": "string"
      +        },
      +        "decimals": {
      +          "type": "integer"
      +        },
      +        "symbol": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "address",
      +        "decimals",
      +        "symbol"
      +      ],
      +      "type": "object"
      +    },
      +    "typedData": {
      +      "properties": {
      +        "domain": {
      +          "type": "object"
      +        },
      +        "message": {
      +          "type": "object"
      +        },
      +        "primaryType": {
      +          "type": "string"
      +        },
      +        "types": {
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "types",
      +        "primaryType",
      +        "domain",
      +        "message"
      +      ],
      +      "type": "object"
      +    },
      +    "validTo": {
      +      "type": "integer"
      +    },
      +    "venue": {
      +      "const": "cow"
      +    },
      +    "verified": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "venue",
      +    "chain",
      +    "chainId",
      +    "tokenIn",
      +    "tokenOut",
      +    "amountIn",
      +    "amountInWei",
      +    "expectedOut",
      +    "expectedOutWei",
      +    "fee",
      +    "minOut",
      +    "minOutWei",
      +    "order",
      +    "typedData",
      +    "approval",
      +    "next"
      +  ],
      +  "type": "object"
      +}
  2. Added

TDQS

B3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose useful traits: the order is unsigned, signing is via eth_signTypedData_v4, an approval tx may be bundled, and no gas is needed for the swap. It does not cover order expiry, whether quotes/allowances are validated, or what state (if any) is changed by the approval tx.

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 dense sentences with the core capability front-loaded and no filler. 'No gas for the swap itself' is terse to the point of being slightly ambiguous, but it earns its place as a differentiator.

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?

An output schema exists, so return values need not be explained, and the description names both artifacts the caller receives. However, for a 7-parameter build tool at 14% schema coverage with no annotations, the missing next-step guidance (sign, then submit via cow_post_order) and undefined parameter units leave real gaps.

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

Parameters2/5

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

Schema description coverage is only 14% (just 'sender'), and the description adds nothing about the 7 parameters. Critical ambiguities remain: whether 'amount' is human-readable or base units, that 'recipient' defaults to 'sender', and what slippageBps=50 means. The phrase 'market order' only loosely implies tokenIn/tokenOut/amount roles.

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 ('Build an unsigned CoW market order') plus the exact output format (EIP-712 typed data for eth_signTypedData_v4) and an optional companion artifact (vault-relayer approval tx). The word 'unsigned' implicitly separates it from cow_post_order, but no sibling is named, so the differentiation is left to inference.

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

Usage Guidelines2/5

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

There is no statement of when to call this versus cow_quote, cow_post_order, or cow_order_status, and no prerequisite such as 'requires a prior cow_quote' is mentioned. The only contextual hint is 'plus the one-time vault-relayer approval tx if needed', which describes an output, not usage guidance.

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