# Microsoft Agent Framework

Each search constructor returns a native `FunctionTool` with the exact SerpApi input schema.


# Install

``` bash
pip install "serpapi-search-tools[microsoft-agent-framework]"
```

If Agent Framework and its model provider are already installed, use `pip install serpapi-search-tools` instead.

``` bash
export SERPAPI_API_KEY="your-serpapi-key"
export OPENAI_API_KEY="your-openai-key"
```


# Run it

``` python
import asyncio

from agent_framework import Agent
from agent_framework.openai import OpenAIChatClient
from serpapi_search_tools import news_search, web_search


async def main():
    agent = Agent(
        client=OpenAIChatClient(model="gpt-5.4-mini"),
        instructions="Use live search, verify important claims, and cite source URLs.",
        tools=[
            news_search(),
            web_search(
                allowed_engines=["google_light", "bing"],
            ),
        ],
    )
    print(await agent.run("Brief me on recent warehouse-robotics developments."))


asyncio.run(main())
```


# Try it

Ask: "Find three recent warehouse-robotics developments, verify the two most important company claims, and cite the original sources."


# Customize the search

``` python
current_news = news_search(
    provider="microsoft-agent-framework",
    default_params={"hl": "en", "gl": "us"},
    result_limit=5,
    include_examples=False,
)
```

Agent Framework accepts the returned `FunctionTool` directly in `Agent.tools`. The same adapter works with any Agent Framework model client.
