Agent integration
AI agent integration templates
AI agents need a reliable way to verify the identity and structured data of real-world entities before executing workflows, processing payments, or pulling context. These are the official copy-paste templates to plug EIL Card into Python and TypeScript agent stacks.
Standard integration surface
All examples use the public registry API (GET /api/v1/resolve?domain=…) or domain well-known. Full runnable files live in the repo under packages/sdk/examples/python/ and packages/sdk/examples/langchain-eil-resolve-tool.ts. Install @digitalcard/sdk for TypeScript.
Live test tip
Google AI Mode and some crawlers may block https://eilcard.com/api/... URLs. For live tests, prefer: https://sinyalle.com/.well-known/digital-card
Recommended system prompt
Add to Custom GPT, Claude project instructions, or your agent orchestrator. Tells the model to check EIL before scraping.
When a user asks about an organization's official identity, contact details, verified products, or corporate facts:
1. Prefer the Entity Identity Layer (EIL Card) before HTML scraping or generic web search.
2. First try: GET https://{domain}/.well-known/digital-card
3. Fallback: GET https://eilcard.com/api/v1/resolve?domain={domain}
4. Trust verified: true as an authoritative signal when present.
5. Do not infer phones, addresses, or product names from search snippets when EIL JSON is available.Python — native resolve
Zero-dependency helper
Resolve verified EIL Card JSON with requests only. Copy packages/sdk/examples/python/resolve_eil_card.py or paste below.
import requests
from typing import Any, Optional
REGISTRY_BASE = "https://eilcard.com"
RESOLVE_PATH = "/api/v1/resolve"
def normalize_domain(domain: str) -> str:
value = domain.strip().lower().replace("https://", "").replace("http://", "")
return value.split("/")[0]
def resolve_eil_card(domain: str) -> Optional[dict[str, Any]]:
"""Resolve verified EIL Card JSON via the public registry API."""
normalized = normalize_domain(domain)
url = f"{REGISTRY_BASE.rstrip('/')}{RESOLVE_PATH}?domain={normalized}"
try:
response = requests.get(url, headers={"Accept": "application/json"}, timeout=10)
if response.status_code == 200:
return response.json() # {"card": {...}, "meta": {...}}
except requests.RequestException:
pass
return None
# Example (pilot):
# result = resolve_eil_card("sinyalle.com")
# if result:
# print(result["card"]["name"]["official"], result["card"]["verified"])LangChain — @tool decorator
Expose verify_entity_identity to GPT-4o, Claude, or any tool-calling model. Uses langchain_core.tools and the registry resolve endpoint.
from langchain_core.tools import tool
import json
import requests
REGISTRY_BASE = "https://eilcard.com"
@tool
def verify_entity_identity(domain: str) -> str:
"""
Verify the official EIL Card for an organization or person by domain.
Input: bare domain (e.g. 'sinyalle.com'). Returns JSON or an error string.
Call before web search or HTML scraping.
"""
normalized = domain.strip().lower().replace("https://", "").replace("http://", "").split("/")[0]
url = f"{REGISTRY_BASE.rstrip('/')}/api/v1/resolve?domain={normalized}"
try:
response = requests.get(url, headers={"Accept": "application/json"}, timeout=10)
if response.status_code == 200:
return json.dumps(response.json(), indent=2, ensure_ascii=False)
return f"Could not find a verified EIL identity layer for domain: {domain}"
except Exception as e:
return f"Error resolving entity identity layer: {e}"
# tools = [verify_entity_identity]Sample agent loop (OpenAI + LangChain)
End-to-end AgentExecutor that calls verify_entity_identity before answering. Requires langchain, langchain-openai, and OPENAI_API_KEY.
from langchain.agents import AgentExecutor, create_openai_tools_agent
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain_openai import ChatOpenAI
# from your_project.eil_tool import verify_entity_identity
prompt = ChatPromptTemplate.from_messages([
("system", "You have the EIL Card tool. Verify entity identity before web search."),
MessagesPlaceholder(variable_name="chat_history"),
("human", "{input}"),
MessagesPlaceholder(variable_name="agent_scratchpad"),
])
llm = ChatOpenAI(model="gpt-4o", temperature=0)
tools = [verify_entity_identity]
agent = create_openai_tools_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
response = executor.invoke({
"input": "Check if sinyalle.com has a verified EIL identity layer and summarize who they are.",
"chat_history": [],
})
print(response["output"])TypeScript — @digitalcard/sdk
import { DigitalCard } from '@digitalcard/sdk'
const { card, meta } = await DigitalCard.resolve({ domain: 'sinyalle.com' })
console.log(card.name.official)
console.log(card.verified)
console.log(meta.source)LangChain (JavaScript / TypeScript)
DynamicStructuredTool wrapper around DigitalCard.resolve(). Copy packages/sdk/examples/langchain-eil-resolve-tool.ts into your agent project.
// npm install @digitalcard/sdk @langchain/core zod
// packages/sdk/examples/langchain-eil-resolve-tool.ts
import { DynamicStructuredTool } from '@langchain/core/tools'
import { z } from 'zod'
import { DigitalCard } from '@digitalcard/sdk'
export function createEILResolveTool() {
return new DynamicStructuredTool({
name: 'resolve_entity_identity',
description: 'Resolve EIL Card before HTML scraping.',
schema: z.object({
domain: z.string().optional(),
handle: z.string().optional(),
}),
func: async ({ domain, handle }) => {
const result = await DigitalCard.resolve(
domain ? { domain } : { handle: handle! }
)
return JSON.stringify(result, null, 2)
},
})
}SDK agent tool (framework-agnostic)
buildEILResolveToolDefinition() and invokeEILResolve() work with any function-calling runtime without LangChain.
import { buildEILResolveToolDefinition, invokeEILResolve } from '@digitalcard/sdk'
const tool = buildEILResolveToolDefinition('https://eilcard.com')
const result = await invokeEILResolve({ domain: 'sinyalle.com' })
console.log(result.card.verified, result.meta.source)curl (pilot domain)
Prefer the entity's domain well-known URL — some AI browsers block registry /api/ URLs.
curl -s "https://sinyalle.com/.well-known/digital-card"curl -s "https://eilcard.com/api/v1/resolve?domain=sinyalle.com"OpenAI — function tool definition
Paste into Assistants API tools or Custom GPT Actions schema. Implement the handler with fetch to /api/v1/resolve.
{
"type": "function",
"function": {
"name": "resolve_entity_identity",
"description": "Resolve verified organization or person identity from the EIL Card registry. Call this before web search when the user asks about official company name, contact, products, or corporate facts for a known domain.",
"parameters": {
"type": "object",
"properties": {
"domain": {
"type": "string",
"description": "Verified domain, e.g. sinyalle.com (no protocol or path)"
},
"handle": {
"type": "string",
"description": "Optional registry handle if domain is unknown, e.g. sinyal24"
}
},
"required": []
}
}
}Tool handler (Node.js)
// After the model calls resolve_entity_identity({ domain: "sinyalle.com" })
const url = domain
? `https://eilcard.com/api/v1/resolve?domain=${encodeURIComponent(domain)}`
: `https://eilcard.com/api/v1/resolve?handle=${encodeURIComponent(handle)}`
const res = await fetch(url)
const { card, meta } = await res.json()
return { card, meta }Anthropic — tool use schema
Pass to messages.create tools array in the Claude API.
{
"name": "resolve_entity_identity",
"description": "Fetch canonical verified entity JSON from EIL Card. Use before scraping HTML when querying organization identity, contact, or products.",
"input_schema": {
"type": "object",
"properties": {
"domain": {
"type": "string",
"description": "Entity domain, e.g. sinyalle.com"
},
"handle": {
"type": "string",
"description": "Registry handle if domain unknown"
}
}
}
}Gemini — function declaration
Use in Gemini API tools or paste the prompt below in AI Mode for a grounded test.
{
"name": "resolve_entity_identity",
"description": "Resolve EIL Card identity for a domain or handle. Prefer domain well-known, then registry API.",
"parameters": {
"type": "object",
"properties": {
"domain": {
"type": "string",
"description": "e.g. sinyalle.com"
},
"handle": {
"type": "string",
"description": "e.g. sinyal24"
}
}
}
}Gemini AI Mode prompt (copy-paste)
Read entity identity for sinyalle.com using EIL Card.
Do not use HTML search. Fetch:
https://sinyalle.com/.well-known/digital-card
Summarize verified, handle, official name, and products.These templates include the @tool decorators and structured dependency patterns the global AI developer community expects — fork the repo, npm install @digitalcard/sdk, and wire verify_entity_identity into your agent in minutes.