Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dzap.io/llms.txt

Use this file to discover all available pages before exploring further.

Use this path when you want to integrate DZap AI into your own application, orchestration layer, or agent runtime.

Good fit

Custom clients are a strong choice when you need:
  • Tighter control over prompts and tool policy.
  • Your own UI or app workflow.
  • Internal guardrails around execution.
  • App-specific logging, auth, or observability.

Integration model

Your App / Agent

Client Layer (your auth, your logging)

DZap MCP (https://ai.dzap.io/sse) or Tool Gateway

DZap Tooling

Protocol / Execution Services

Step 1: Define your tool subset

Most apps should not expose every available capability. Start narrow:
  • Asset discovery
  • Balances and positions
  • Route and quote generation
  • Build and simulate

Step 2: Add role-aware behavior

Different users or agents may need different tool access:
  • Support copilot — docs + read-only tooling.
  • Analyst agent — research + market tools.
  • Execution copilot — build + simulate + explicit approval path.

Step 3: Keep confirmations explicit

For anything that may lead to execution, the client should make the assistant state:
  • What will happen.
  • What chain and asset are involved.
  • What assumptions were made.
  • Whether this is read, build, simulate, or execute.

Step 4: Log tool usage

At minimum, log:
  • Selected tool.
  • Normalized inputs.
  • Returned outputs.
  • Decision step in the conversation.
  • Whether the action was gated or confirmed.

Connecting via the MCP SDK

import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';

const transport = new SSEClientTransport(new URL('https://ai.dzap.io/sse'));

const client = new Client(
  { name: 'my-agent', version: '1.0.0' },
  { capabilities: {} },
);

await client.connect(transport);

// Discover tools
const tools = await client.listTools();
console.log(tools.tools.map(t => t.name));

// Call a tool
const result = await client.callTool({
  name: 'PriceTool',
  arguments: {
    tokenAddresses: '0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eB48',
    chainId: 1,
  },
});

Design tips

Prefer tool orchestration over free-form prompting

Let the client orchestrate structure. Let the model do interpretation.

Separate advisory from execution-capable flows

Don’t make every agent one prompt away from execution.

Make failure states readable

Users should understand whether the system failed because of:
  • Missing wallet context.
  • Unsupported chain or asset.
  • Invalid arguments.
  • Policy restrictions.
  • Transport or service errors.

See also