SDK QUICKSTART
Verify emails from LlamaIndex.
Tool spec for LlamaIndex agents, same structured verdict shape as the LangChain tool.
1. Install
Grab a free API key at tooltrace.io/signup. The free plan includes 1,000 verifications per month.
pip install tooltrace-llamaindex 2. Quickstart
Set TOOLTRACE_KEY in your environment, then verify a single address.
import os
from llama_index.llms.openai import OpenAI
from llama_index.core.agent import ReActAgent
from tooltrace_llamaindex import ToolTraceVerifyEmailTool
verify_email = ToolTraceVerifyEmailTool(api_key=os.environ["TOOLTRACE_KEY"])
agent = ReActAgent.from_tools(
[verify_email],
llm=OpenAI(model="gpt-5", temperature=0),
verbose=True,
)
response = agent.chat(
"Can [email protected] actually receive mail? If not, explain why."
)
print(response) 3. Advanced
Patterns for production use: idempotency, retries, and typed errors.
# The tool returns a structured payload the agent can quote back:
#
# {
# "status": "risky",
# "score": 42,
# "reasons": ["typo_suggested"],
# "suggestion": "[email protected]"
# }
#
# A well-prompted agent will reply:
#
# "I checked [email protected] and the result was 'risky' with a score of
# 42. The reason is 'typo_suggested': the domain acme.co looks like a
# typo of acme.com. Want me to verify [email protected] instead?"
#
# ToolTrace exposes 'reasons' as a structured list, not a free-text
# explanation, so the agent quotes the field directly without
# hallucinating a plausible-sounding reason. What you get
- One-line tool install for LlamaIndex agents and ReAct loops
- Structured response: status, 0-100 score, atomic checks, reasons, suggestion
- Works with any LlamaIndex-compatible LLM (OpenAI, Anthropic, Mistral, local)
- Shares the credit pool with every other ToolTrace API
- Deterministic: same input returns the same output, cached for 7 days