Skip to main content
Glama

web_search

Search the web via Ollama's hosted API and get titles, URLs, and content snippets for any query. Adjust max results to control the number of returned items.

Instructions

    Perform a web search using Ollama's hosted search API.
    
    Requires OLLAMA_API_KEY environment variable to be set.

    Args:
        query: The search query to run.
        max_results: Maximum results to return (default: 3, max: 20).

    Returns:
        JSON-serializable dict with search results including titles, URLs, and content snippets.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
max_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the behavioral disclosure burden. It discloses the required environment variable and the JSON-serializable result shape containing titles, URLs, and snippets. It does not mention failure modes, rate limits, or latency, but for a search tool the disclosed behavior is solid.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: the action is stated immediately, followed by the prerequisite, parameters, and return format. Every sentence earns its place, with no filler or redundant marketing language.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter tool with an output schema, the description covers the prerequisite, parameter constraints, and return format, which is largely complete. It stops short of a 5 because it does not address when to prefer web_fetch, chat_completion, or search_and_chat, or what happens when the API key is invalid.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description fully compensates by explaining both parameters: query is the search query, and max_results is the maximum result count with default 3 and max 20. It even adds the max:20 constraint that the schema does not express.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Perform a web search') and the resource ('Ollama's hosted search API'), making the tool's purpose specific and understandable. However, it does not explicitly contrast itself with sibling tools like search_and_chat or web_fetch, so it misses the top score for sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage whenever a web search is requested and states the OLLAMA_API_KEY prerequisite. However, it gives no explicit when-to-use vs. when-not-to-use guidance and does not mention alternatives such as search_and_chat for combined search-and-answer scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/timscodebase/ollamaMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server