> ## Documentation Index
> Fetch the complete documentation index at: https://platform-docs.sarj.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use OpenAPI for fields and errors; the Python guide and PyPI for SDK capabilities and availability. Scenario IDs are dashboard UUIDs. Bound polling; reports may stay null. Reconcile ambiguous call creation before retrying. Docs MCP reads docs and accepts feedback; API MCP performs authenticated call actions.

# AI SDK

> Use Sarj call-read tools in server-side AI SDK applications.

The [npm package](https://www.npmjs.com/package/@sarj-ai/ai-sdk-tools) provides `listCalls`, `getCall`, `getCallTranscript`, and `getCallAnalysis` over [MCP](https://platform-docs.sarj.ai/mcp-server.md).

Requires Node.js 22+, ESM, AI SDK 7, an existing Sarj organization, and a role-authorized `calls:read` key. `getCall` requires `calls:read`; the other tools also require [organization `reads` access](https://platform-docs.sarj.ai/mcp-server#pilot-capabilities). Configure AI Gateway credentials separately.

```sh theme={null}
npm install @sarj-ai/ai-sdk-tools@0.1.0 ai@^7.0.183
```

```ts theme={null}
import { generateText, isStepCount } from 'ai';
import { createSarjTools } from '@sarj-ai/ai-sdk-tools';

const apiKey = process.env.SARJ_API_KEY;
if (!apiKey) throw new Error('Set SARJ_API_KEY.');
const sarj = await createSarjTools({ apiKey });
try {
  await generateText({
    model: 'openai/gpt-5-mini',
    tools: sarj.tools,
    prompt: 'List three recent calls; omit personal data.',
    stopWhen: isStepCount(3),
  });
} finally {
  await sarj.close();
}
```

Keep credentials server-side. Authorize users; tool results can reach your model and telemetry. Close after consuming streams. See the [package reference](https://github.com/sarj-ai/mcp-integrations/tree/main/packages/ai-sdk-tools) and [privacy policy](https://sarj.ai/privacy).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.