Private beta. Early API keys for agent builders, with a free daily sandbox allowance. Read the quickstart

Tool schemas

GET /v1/tools returns the Lineage tools as function definitions for Grok, OpenRouter models, OpenAI-compatible clients and the Anthropic API.

The tools are the same ones the MCP server lists. Each has a name, a description written for a model, and a JSON Schema for its arguments with every field described. No key is needed to read them. Your code runs a tool call by sending the matching request in the endpoints map, with your key.

curl "https://api.lineage.rexstjohn.com/v1/tools?format=openai"
formatShape
openai{ type: function, function: { name, description, parameters } }, the default
anthropic{ name, description, input_schema }
mcp{ name, description, inputSchema, annotations }

With an OpenAI-compatible client

Pass the tools to chat completions on xAI (Grok), OpenRouter or any OpenAI-compatible endpoint. When the model returns a tool call, run it with runTool from @lineage/sdk, which maps the name and arguments onto the endpoint, waits for searches, and returns API errors as data the model can read. The grok-tools-example template in the repo does this end to end.

import { LineageClient, openAiTools, runTool } from "@lineage/sdk";

const lineage = new LineageClient(); // reads LINEAGE_API_KEY
const tools = openAiTools();
// ... model returns message.tool_calls
for (const call of message.tool_calls) {
  const result = await runTool(lineage, call.function.name, JSON.parse(call.function.arguments));
  messages.push({ role: "tool", tool_call_id: call.id, content: JSON.stringify(result.ok ? result.data : result.error) });
}

Tools

ToolEndpointCharges credits
search_recordsPOST /v1/searchesYes, see the description
get_recordGET /v1/records/{id}No
resolve_subjectPOST /v1/subjects:resolveYes, see the description
get_subjectGET /v1/subjects/{id}No
select_candidatePOST /v1/subjects/{id}:selectNo
check_vital_statusPOST /v1/subjects/{id}/vital-statusYes, see the description
run_researchPOST /v1/runsYes, see the description
get_runGET /v1/runs/{id}No
export_gedcomGET /v1/searches/{id}/exportNo
list_sourcesGET /v1/sourcesNo
get_sourceGET /v1/sources/{slug}No
list_modelsGET /v1/modelsNo
draft_contact_requestPOST /v1/contact-requestsNo
list_archivesGET /v1/archivesNo
get_keyGET /v1/keyNo

Good to know

  • Searches about anyone who may be alive return living_person_blocked and cost 0 credits. Lineage researches someone only when a death date is on record, or a birth more than 110 years ago. A relative who may be alive comes back as { relation, living: true } with no name, dates or places.
  • wait_seconds and idempotency_key are tool arguments, not API fields: runTool sends the key as the Idempotency-Key header and polls for up to wait_seconds.
  • Every record in a result has citation.url. Have the model quote the source and locator rather than paraphrase.