Skip to main content

Agent Adapter Contract

Wendell runs your production agent through agent_command.

The command receives a JSON work item on stdin and must print a JSON response on stdout.

Input shape

The payload includes:

{
"schema_version": "wendell.agent_input.v1",
"task": "Respond as an agent in a Wendell remote runtime scenario.",
"scenario": {
"id": "playbook_workflow_1",
"title": "Evaluate refund request",
"customer_goal": "Request a refund that must follow policy."
},
"transcript": [],
"available_tools": [
{
"name": "orders.lookup",
"arguments": {"order_id": "str"},
"description": "Look up an order."
}
],
"case": {
"case_id": "case_123",
"request": "I need help with this refund."
},
"instruction": "Return JSON with `message`, `tool_calls`, and optional `metrics`."
}

Fields may grow over time. Adapters should ignore unknown fields.

Wendell does not send scoring rubrics, hidden facts, expected outcomes, source lineage, terminal outcomes, or success/failure criteria to the agent process. Those stay inside Wendell's evaluator.

Output shape

Return a JSON object:

{
"message": "I can help with that refund. I need to look up the order first.",
"tool_calls": [
{
"name": "orders.lookup",
"args": {"order_id": "example"},
"result": {"found": true}
}
],
"metrics": {
"latency_ms": 1200
}
}

Required fields:

FieldTypeDescription
messagestringAgent response text.
tool_callsarrayTool calls made by the agent. Use [] if none.

Optional fields:

FieldTypeDescription
metricsobjectRuntime metrics to attach to the turn.

Example Python adapter

import json
import sys


def main() -> None:
payload = json.load(sys.stdin)
scenario = payload.get("scenario", {})
customer_goal = scenario.get("customer_goal", "the request")

response = {
"message": f"I will handle {customer_goal} according to the approved Playbook.",
"tool_calls": [],
"metrics": {},
}
print(json.dumps(response))


if __name__ == "__main__":
main()

Configure it:

agent_command = "python scripts/wendell_agent_adapter.py"

Failure behavior

If the command exits nonzero, Wendell records an agent error for the turn.

If stdout is not valid JSON, the generated adapter template fails fast with a clear error. Some lower-level Wendell runtime paths can wrap raw stdout as a plain text message, but production adapters should always print the JSON object above.

If tool_calls is missing, use [] in your adapter to keep behavior explicit.