Define Andi search as a tool or function for an AI agent framework.
AI agents use tool definitions to decide when and how to call external services. This example shows how to define Andi search as a tool that your agent can invoke to retrieve current web information.
Define the search tool with a description, parameters, and expected output:
Copy
search_tool = { "type": "function", "function": { "name": "web_search", "description": "Search the web for current information. Use this when the user asks about recent events, facts you're unsure about, or anything that requires up-to-date information.", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "The search query", }, "limit": { "type": "integer", "description": "Number of results (1-100, default 10)", }, }, "required": ["query"], }, },}
The same pattern works with any agent framework. See Build with AI agents for MCP server integration, which lets tools like Claude Code and Cursor access the docs directly.