Skip to main content
Glama
Metrx MCP Server

Metrx MCP Server

by metrxbots

Set Job Contract

metrx_set_job_contract

Publish a NEW VERSION of an agent's job contract (append-only: the previous active version for the same workload is superseded in the same transaction).

Instructions

Publish a NEW VERSION of an agent's job contract (append-only: the previous active version for the same workload is superseded in the same transaction). Required: workload, objective, unit_of_work, acceptance_criteria (1-20), kpi_target, budget (dollars per daily|weekly|monthly period, stored as micro-dollars), owner. Optional: human_baseline (what a person costs per unit, in dollars), and the vendor terms vendor_name, billable_unit and vendor_resolved_definition (the vendor's own wording, kept verbatim, not verified); on a new version an omitted optional keeps the current value and null clears it. Workload-policy terms are inherited from the current version unless supplied in policy_terms. For an agent with no version yet, set policy_defaults: 'inherit_workload_policy' copies the org's workload-level policy (a snapshot), 'observe_only' gets terms that grant no authority (needs task_verb and domain in policy_terms); otherwise every term must be in policy_terms. The contract is RECORDED, not enforced at runtime: nothing blocks spend or traffic on it. Needs an API key with the 'admin' scope — an org owner or admin mints one in Settings → Security → API Keys; any other key is refused with 403. Do NOT use to read a contract — use get_job_contract. Requires an API key with the 'admin' scope.

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": {
      "agent_key": "<agent_key>",
      "workload": "<workload>",
      "objective": "<objective>",
      "unit_of_work": "<unit_of_work>",
      "acceptance_criteria": "<acceptance_criteria>",
      "kpi_target": "<kpi_target>",
      "budget_dollars": "<budget_dollars>",
      "budget_period": "<budget_period>",
      "owner": "<owner>"
    },
    "name": "metrx_set_job_contract"
  }
}

Input Schema

NameRequiredDescriptionDefault
notesNoOptional note recorded on this version
ownerYesUser id or email accountable for this agent
workloadYesWorkload label the contract governs (e.g. 'extraction')
agent_keyYesThe agent_key (the X-Agent-ID string), not the UUID
objectiveYesWhat this agent is for, in your words
kpi_targetYesThe number the agent is held to over a rolling window
vendor_nameNoWho you pay for this agent’s work (the AI vendor). null clears it.
policy_termsNoOptional workload-policy terms (unit, eligible_traffic, primary_quality, critical_guardrails, signal, non_inferiority, cost_definition, permitted_actions, exposure_budget, rollback_fast, rollback_slow, evidence_expiry, task_verb, domain). Omit to inherit from the current version.
unit_of_workYesThe countable output (e.g. 'one DDQ reviewed')
billable_unitNoWhat the vendor bills per, in the vendor's words (e.g. 'resolution'). null clears it.
budget_periodYesBudget period
budget_dollarsYesDeclared spend limit in dollars per period (recorded, not enforced)
human_baselineNoOptional, owner-stated, never measured. Omit to keep the current version’s; null clears it.
policy_defaultsNoFirst version only: where engine terms come from. 'inherit_workload_policy' copies the org's active workload-level policy (refused when none exists); 'observe_only' grants no authority (every action class shadow). Ignored when the agent already has a version.
acceptance_criteriaYesWhat "done well" means: 1-20 {metric, op, threshold, window}
vendor_resolved_definitionNoThe vendor's own definition of "resolved", word for word. Stored unchanged and shown as the vendor's definition, not verified. null clears it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.6.3
    • addedInput schema / properties / billable_unit
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 100,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "What the vendor bills per, in the vendor's words (e.g. 'resolution'). null clears it."
      +}
    • addedInput schema / properties / human_baseline
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "basis": {
      +          "description": "How the figure was arrived at (e.g. time sheets, a quote)",
      +          "maxLength": 500,
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "cost_per_unit_usd": {
      +          "description": "What one unit costs when a person does it, in dollars",
      +          "type": "number"
      +        },
      +        "minutes_per_unit": {
      +          "anyOf": [
      +            {
      +              "exclusiveMinimum": 0,
      +              "maximum": 100000,
      +              "type": "number"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "A person's minutes per unit, when known"
      +        }
      +      },
      +      "required": [
      +        "cost_per_unit_usd",
      +        "basis"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Optional, owner-stated, never measured. Omit to keep the current version’s; null clears it."
      +}
    • addedInput schema / properties / vendor_name
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 200,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Who you pay for this agent’s work (the AI vendor). null clears it."
      +}
    • addedInput schema / properties / vendor_resolved_definition
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 2000,
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "The vendor's own definition of \"resolved\", word for word. Stored unchanged and shown as the vendor's definition, not verified. null clears it."
      +}
  2. Addedv0.5.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that the contract is RECORDED but not enforced ('nothing blocks spend or traffic on it'), the supersede-on-write transaction behavior, the inherit-vs-clear semantics for omitted optionals, and the admin-scope API-key requirement with a 403 on any other key. Annotations only say it is a non-idempotent, non-destructive, closed-world write; the description supplies the operational consequences.

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-loads the append-only write model, then required vs optional fields, then the first-version branch, then the auth requirement — a sensible order. It loses a point for the verbatim repeated sentence 'Requires an API key with the admin scope' at the end and for very dense parentheticals, but almost every clause carries information an agent needs.

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

Completeness5/5

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

For a 16-parameter mutation tool with nested objects and no output schema, the description covers required fields, optional-clearing semantics, the first-version policy branch, workload-policy inheritance, and the auth/403 failure mode. An agent has enough to call it correctly on both a first version and a subsequent version.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds genuine meaning: budget is dollars per daily|weekly|monthly period stored as micro-dollars, human_baseline is 'what a person costs per unit' and never measured, vendor_resolved_definition is kept verbatim and not verified, and omitted-vs-null differ for optional fields on a new version. It repeats a few field names the schema already documents, but the storage and inheritance semantics are new information.

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 — 'Publish a NEW VERSION of an agent's job contract' — and immediately clarifies the append-only model where the prior active version is superseded in the same transaction. It also names the read counterpart (get_job_contract), so an agent can distinguish the write path from the read path without opening a schema.

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

Usage Guidelines4/5

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

Explicitly says 'Do NOT use to read a contract — use get_job_contract' and details the first-version branch: policy_defaults 'inherit_workload_policy' vs 'observe_only', and the fallback requiring every term in policy_terms. It does not mention the sibling metrx_draft_job_contract as the dry-run alternative, leaving that routing to inference.

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