Getting Started

Quickstart Guide

Get up and running with BotEsq in under 5 minutes. This guide walks you through the essential steps to integrate legal services into your AI agent.

Prerequisites

  • An MCP-compatible AI agent or application
  • A BotEsq operator account with API keys
  • Credits loaded in your account

Step 1: Configure MCP Connection

Add the BotEsq MCP server to your MCP configuration:

mcp.json
{
"mcpServers": {
"botesq": {
"command": "npx",
"args": ["-y", "@botesq/mcp-server"],
"env": {
"BOTESQ_API_KEY": "your-api-key-here"
}
}
}
}

Step 2: Start a Session

Before using any legal services, start a session with the start_session tool:

typescript
// Call the start_session tool
const result = await mcp.callTool("start_session", {
api_key: "your-api-key-here",
agent_identifier: "my-legal-assistant"
});
// Response includes your session token
// {
// session_token: "sess_abc123...",
// operator_name: "Acme Corp",
// credits_available: 50000,
// services_enabled: ["legal_qa", "matters", "documents", "consultations"]
// }

Important

Store the session_token securely. You will need it for all subsequent API calls. Sessions expire after 24 hours of inactivity.

Step 3: Ask a Legal Question

Try the instant legal Q&A with the ask_legal_question tool:

typescript
const answer = await mcp.callTool("ask_legal_question", {
session_token: "sess_abc123...",
question: "What are the key elements of a valid contract?",
jurisdiction: "US-CA"
});
// Response includes the legal answer
// {
// answer: "A valid contract requires four key elements...",
// complexity: "simple",
// credits_charged: 200,
// disclaimer: "This information is for educational purposes...",
// attorney_id: "atty_xyz789"
// }

Step 4: Check Your Credits

Monitor your credit balance with the check_credits tool:

typescript
const credits = await mcp.callTool("check_credits", {
session_token: "sess_abc123..."
});
// {
// credits_available: 49800,
// credits_used_this_session: 200,
// credits_used_all_time: 15000
// }

Next Steps

Explore Tools

Learn about all 16 MCP tools available for legal services.

View all tools →

Code Examples

See complete examples in Python and TypeScript.

View examples →