isError: true, so the calling agent can reason about it and decide what to do next — retry, adjust arguments, or explain the failure to a human.
Tool-level error shape
Policy denials
xentfi_create_payment is checked against the agent’s Policy server-side on every call, regardless of what the client validated beforehand. A denied payment comes back as a tool error (not a crash), with code: "POLICY_DENIED" and a hint pointing the agent at xentfi_get_policy to inspect current limits and spend before retrying with different parameters.
Authentication failures
A401/403 from any tool comes back with hint: "Check that the agent API key is valid and has not been revoked or suspended." Common causes:
Missing XENTFI_AGENT_KEY
Missing XENTFI_AGENT_KEY
The stdio server logs
Missing XentFi agent API key to stderr and every tool call fails identically. Fix the env block in your MCP client’s config — see the client-specific guide (e.g. Claude Desktop).Revoked or suspended agent
Revoked or suspended agent
xentfi_get_agent_info will show status: "SUSPENDED" or "REVOKED". Re-enable the agent or issue a new key from the dashboard.Wrong environment's key
Wrong environment's key
A sandbox key against production
XENTFI_BASE_URL (or vice versa) returns 401. Double check XENTFI_BASE_URL matches the environment the key was issued in.Programmatic use (outside of tool handlers)
If you’re usingXentfiClient directly rather than through the MCP tool layer, failures raise real exceptions instead of a JSON tool result:

