Set Job Contract
metrx_set_job_contractPublishes a new version of an agent's job contract, superseding the prior active version for the same workload, with objective, acceptance criteria, KPI target, budget, and owner.
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. 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
| Name | Required | Description | Default |
|---|---|---|---|
| notes | No | Optional note recorded on this version | |
| owner | Yes | User id or email accountable for this agent | |
| workload | Yes | Workload label the contract governs (e.g. 'extraction') | |
| agent_key | Yes | The agent_key (the X-Agent-ID string), not the UUID | |
| objective | Yes | What this agent is for, in your words | |
| kpi_target | Yes | The number the agent is held to over a rolling window | |
| policy_terms | No | Optional 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_work | Yes | The countable output (e.g. 'one DDQ reviewed') | |
| budget_period | Yes | Budget period | |
| budget_dollars | Yes | Declared spend limit in dollars per period (recorded, not enforced) | |
| policy_defaults | No | First 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_criteria | Yes | What "done well" means: 1-20 {metric, op, threshold, window} |