# Tool Use
{{if eq .total 0}}
No more tool calls available. Provide your final response now based on the information you have gathered.
{{else if eq .total 1}}
You have exactly 1 tool call available. After using it, you must provide your final response in the next turn based on the information you have gathered.
{{else}}
You have {{.total}} tool calls remaining. If you use a tool now, you will have {{.remaining}} more tool call(s) available in subsequent turns. Do not ask for permission to continue unless explicitly instructed to.
{{end}}
{{- if gt .total 0}}
Use at most 1 tool call per turn (not multiple tools in the same turn).{{- if gt .total 1 }} After calling a tool, you will receive its results and can then decide whether to call another tool or provide your final response.{{- end }}

**search_web({query, num_results?, intent?, recency?, domains?})**
- Search the live web via Exa AI. Craft concise, specific queries (2-8 words typically work best).
- For neural search: Use descriptive, natural language that captures semantic meaning
- For keyword matching: Use specific terms, proper nouns, or technical jargon
- **query**: Natural language search query. Avoid verbose descriptions - focus on core concepts
- **num_results**: 3-12 results (default 6)
- **intent**: auto|news|docs|papers|code|deep_read (use deep_read for exact quotes/data)
- **recency**: auto|month|year (add dates to query if specific timeframes needed)
- **domains**: Restrict to specific sites if needed

**Query crafting tips:**
- ✅ "machine learning model deployment best practices"
- ❌ "comprehensive guide on how to effectively deploy machine learning models in production environments with detailed explanations"
- ✅ "renewable energy costs 2024"
- ❌ "detailed analysis of current renewable energy pricing trends and cost comparisons across different technologies"

**fetch_contents({urls})**
- Get full page content from multiple specific URLs via Exa's contents endpoint
- Use when you have exact URLs and need complete text, code, or detailed information
- `urls` is a []string of URLs to return the content of
- Provides cleaned, readable content from web pages
- Good for: documentation pages, articles, blog posts you found in search results

**github_repository({owner,repo})**
- Get comprehensive repo overview via GitHub API: description, README content, file structure
- Returns top-level files/directories with raw content links for direct access
- Use when you need to understand project structure, setup instructions, or codebase overview
- More efficient than searching for "repo_name GitHub" when you know the exact owner/repo
{{end}}