Blog / AI agents

AI agents

Giving AI agents live web data: MCP servers, tool calling, agent workflows, and keeping an agent's data costs predictable.

  1. Web Search API for AI Agents: Four Engines Compared

    Google, Brave, Bing and DuckDuckGo search endpoints compared by their recorded JSON, with one Python normaliser for agents. 1 credit per search.

  2. AI Agent Tools: What an Agent Needs for Web Data

    An agent tool is a name, a description, an input schema and a result. How search, lookup and fetch tools map to three MCP tools, two of them free.

  3. Website to Markdown: Clean Page Text for LLMs

    Turn a website into markdown with one call (response_type=markdown, 1 credit a page) or with markdownify in Python, then strip what an LLM doesn't need.

  4. What Is an MCP Server? A Working Example with Web Data

    An MCP server exposes tools, resources and prompts to AI apps over stdio or Streamable HTTP. See a real tools/list and tools/call, and what each costs.

  5. Remote MCP Server: Streamable HTTP vs Local stdio

    A remote MCP server runs over Streamable HTTP: one POST endpoint, auth headers, Origin checks, no sessions. Real responses, and when stdio fits better.

  6. CrewAI Tools: Build a Custom Tool for Live Web Data

    Build a CrewAI custom tool (a BaseTool subclass) that searches Google for live results, cap it at 5 calls a run, or load MCP tools instead. Tested code.

  7. MCP Server Authentication: API Keys vs OAuth

    The MCP spec makes OAuth 2.1 optional for remote servers. When a static API key in an Authorization header fits better, and how clients send one.

  8. Build a Market Research Agent with Search and Trends Data

    Wire Google Search, Trends and News into one Python agent, cap it at 8 credits per question, and see a recorded Trends response.

  9. Trim API Responses for LLM Context: Fewer Tokens per Call

    Cut a Google Shopping response from 1,358 to 422 characters by keeping 8 fields. Python code, a measured before and after, and 1 credit per call.

  10. MCP Server Too Many Tools: Keeping Agent Context Small

    One tool per endpoint for 1,659 endpoints is about 567,000 characters of schema. A 10-step checklist to keep an MCP server's tool list small.

  11. Track Brand Mentions in AI Answers with an API

    A daily Python job that sends fixed prompts to an LLM answers endpoint and Google's AI overview, logs brand mentions and cited domains, at 2 credits per prompt.

  12. How to Add an MCP Server to Claude Desktop and Cursor

    Add the Perceptlayer MCP server to Claude Desktop or Cursor with an API key header, run a first Google search, and check only successful calls cost credits.

  13. VS Code MCP Server Setup: Add Live Web Data to Copilot

    Add Perceptlayer's MCP server to VS Code in .vscode/mcp.json with a password input for the key, run a first search in agent mode and check credits per call.

  14. Build a Price Tracking Agent in Python with Live Data

    A Python price tracker that checks Google Shopping and eBay once per product per run, stores history in SQLite, flags drops and costs 2 credits a product.

  15. AI Travel Planning Agent: Flights and Hotels via MCP

    Chain Google Flights and hotel search through MCP tools in one agent. The exact tool calls, a runnable script and the 6 credits one trip plan costs.

  16. OpenAI Agents SDK with a Remote MCP Server for Web Data

    Connect the OpenAI Agents SDK to a Streamable HTTP MCP server with a Bearer header, cap call_endpoint at 3 calls a question, and count credits per run.

  17. RAG with Live Web Data: When to Skip the Vector Store

    Which RAG questions need a stored index and which need a fresh call. A per-query Google Search lookup costs 1 credit, with the latency trade-off.

  18. MCP Tool Call Error Handling: When an Agent Should Retry

    Each call_endpoint error code mapped to one agent action (fix, wait, stop or ask the user), with the exact error text the model sees and a system prompt.

  19. MCP vs Function Calling for Live Web Data in Agents

    One Google Maps endpoint as an MCP tool and as a hand-written function: setup, where each spends tokens, upkeep, and a verdict per use case.

  20. MCP Server for Web Scraping: Tools Agents Can Call

    An MCP server gives an agent three tools to find, inspect and call web endpoints. Use the scraper for uncatalogued pages, structured endpoints for the rest.

  21. Build an AI Property Research Agent with Live Listings

    A Python agent that pulls Redfin and Zillow data for one home, compares list price, Zestimate, last sale and tax value, and caps each question at 4 credits.

  22. Add Web Search to an OpenAI Agent: Python Tool Calls

    Add web search to an OpenAI agent in Python: one web_search tool over live Google results, a tool-call loop and a cap of 1 credit per search.

  23. Summarise Restaurant Reviews with an AI Agent

    An AI review summarizer for Google Maps and Yelp: themes tied to review IDs, quotes checked against the text, and a flag for claims the reviews don't support.

  24. Scheduled AI Agent Runs: Budgeting Credits per Run

    Cap an agent at N calls per run with a Python ledger that reads X-Credits-Used, plus the math for hourly and daily runs on 100 credits on signup.

  25. LLM Tool Schema Design: A Checklist for Web APIs

    LLM tool schema design checklist, applied to the Google Maps simple-search endpoint: a before and after schema that cuts 28 result fields to 7.

  26. LangChain Custom Tool for Live Web Data: Python Tutorial

    Build a LangChain tool in Python for Google Search and News: typed arguments, retries on 429, 502 and 503 only, and a per-run credit cap.

  27. MCP Server Rate Limiting: Keep Agent Tool Calls in Check

    Where to rate limit MCP agent tool calls, with a worked loop against a 60-requests-a-minute account, Retry-After handling and the credit math.

  28. AI Shopping Agent: Compare Prices Across Marketplaces

    A Python AI shopping agent that searches Google Shopping, Walmart and AliExpress, normalises offers into one table and stops at a credit cap of 6 per question.

  29. AI Agent API Cost Control: Cap Web Data Spend

    Cap an agent's web data spend per run: credit arithmetic for 8 and 20 calls per task, a Python budget wrapper, and why failed calls cost 0 credits.

  30. Job Search Agent: Match Postings to a CV with Live Data

    Build an AI job search agent in Python: Indeed postings, Glassdoor pay and ratings, ranked by CV skill match locally. About 12 credits a run.

  31. AI Competitor Monitoring Agent: News, Search and Reviews

    A weekly Python agent checks news, Google results and Trustpilot reviews for each competitor, keeps only new URLs and review IDs, and costs 3 credits a company.

  32. Claude MCP Web Search: Live Results for an Agent

    Add the Perceptlayer MCP server to Claude, let the agent call the Google Search endpoint, and count its cost: 1 credit per search call.

  33. Verify Agent Answers with Live Search: A Grounding Pattern

    Check a model's claim against Google Search and Google News JSON with two calls (2 credits), and handle stale or conflicting sources honestly.