> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Team with Custom Tools

> Combine an `@tool`-decorated FAQ lookup with a web-search agent member so a team answers from a knowledge base first and falls back to search.

Create a team that uses custom tools alongside agent tools to answer questions from a knowledge base and fall back to web search when needed.

## Code

```python team_with_custom_tools.py theme={null}
from agno.agent import Agent
from agno.team import Team
from agno.tools import tool
from agno.tools.websearch import WebSearchTools


@tool()
def answer_from_known_questions(question: str) -> str:
    """Answer a question from a small built-in FAQ."""
    faq = {
        "What is the capital of France?": "Paris",
        "What is the capital of Germany?": "Berlin",
        "What is the capital of Italy?": "Rome",
        "What is the capital of Spain?": "Madrid",
        "What is the capital of Portugal?": "Lisbon",
        "What is the capital of Greece?": "Athens",
        "What is the capital of Turkey?": "Ankara",
    }

    if question in faq:
        return f"From my knowledge base: {faq[question]}"
    return "I don't have that information in my knowledge base. Try asking the web search agent."


# Create web search agent for fallback
web_agent = Agent(
    name="Web Agent",
    role="Search the web for information",
    tools=[WebSearchTools()],
    markdown=True,
)

# Create team with custom tool and agent members
team = Team(name="Q & A team", members=[web_agent], tools=[answer_from_known_questions])

# Test the team
team.print_response("What is the capital of France?", stream=True)

# Display session information
print("\nTeam Session Info:")
print(f"   Session ID: {team.session_id}")
print(f"   Session State: {team.session_state}")

# Show team capabilities
print("\nTeam Tools Available:")
for t in team.tools:
    print(f"   - {t.name}: {t.description}")

print("\nTeam Members:")
for member in team.members:
    print(f"   - {member.name}: {member.role}")
```

## Usage

<Steps>
  <Step title="Create a Python file">
    Create `team_with_custom_tools.py` with the code above.
  </Step>

  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno openai ddgs
    ```
  </Step>

  <Step title="Export your OpenAI API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run Team">
    ```bash theme={null}
    python team_with_custom_tools.py
    ```
  </Step>
</Steps>
