Skip to main content

Scenario

You are building your own agent rather than using a desktop client. You want Titan’s tools available to your model, with production-grade handling for polling, retries, and errors.

Install an SDK

Connect

A resilient call wrapper

Wrap tool calls once so every call gets the same error handling, retries, and polling.
callAndWait collapses the synchronous and asynchronous cases into one path, so calling code does not branch on whether a run finished inside the wait window.

Expose the tools to a model

MCP tool definitions map onto the Claude API tool format directly:
Returning tool errors to the model as is_error results lets it adapt—switching search providers after a rate limit, or narrowing a query that returned nothing.
Several agent frameworks connect to MCP servers natively, which removes the loop above entirely. Check whether yours supports remote MCP before writing your own.

Add idempotency

Derive a stable key from the request so retries never double-charge:
See Idempotency and retries.

Reconcile spend

Every run carries a run_id that is also the Titan execution_id, so agent cost is auditable:
You can also read usage.credits_consumed from each tool response and accumulate it per session, which avoids an extra API call when you only need a running total.

Production checklist

Next steps