> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc-agui.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Team Tool Call Metrics

Access team leader metrics, member run metrics, and tool execution timing with `ToolCallMetrics`.

## Code

```python team_tool_metrics.py theme={null}
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.team import Team
from agno.tools.yfinance import YFinanceTools
from rich.pretty import pprint

stock_searcher = Agent(
    name="Stock Searcher",
    model=OpenAIChat(id="gpt-4o-mini"),
    role="Searches for stock information.",
    tools=[YFinanceTools()],
)

team = Team(
    name="Stock Research Team",
    model=OpenAIChat(id="gpt-4o-mini"),
    members=[stock_searcher],
    markdown=True,
    show_members_responses=True,
    store_member_responses=True,
)

if __name__ == "__main__":
    run_output = team.run("What is the stock price of NVDA?")

    # Team leader run metrics
    print("=" * 50)
    print("TEAM LEADER RUN METRICS")
    print("=" * 50)
    pprint(run_output.metrics)

    # Member metrics and tool call timing
    print("=" * 50)
    print("MEMBER METRICS AND TOOL CALLS")
    print("=" * 50)
    if run_output.member_responses:
        for member_response in run_output.member_responses:
            print(f"\nMember: {member_response.agent_name}")
            print("-" * 40)
            pprint(member_response.metrics)

            if member_response.tools:
                print(f"\nTool calls ({len(member_response.tools)}):")
                for tool_call in member_response.tools:
                    print(f"  Tool: {tool_call.tool_name}")
                    if tool_call.metrics:
                        pprint(tool_call.metrics)
```

## Usage

<Steps>
  <Step title="Create a Python file">
    Create `team_tool_metrics.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 yfinance
    ```
  </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_tool_metrics.py
    ```
  </Step>
</Steps>
