Skip to main content
Glama

codebrain_status

Check locally available Ollama models to verify backend reachability and discover pulled models.

Instructions

Report which Ollama models are available locally.

Call this to verify the local backend is reachable and discover which models the user has pulled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'codebrain_status' tool handler (registered via @mcp.tool()). Calls list_models() and reports which Ollama models are available locally.
    @mcp.tool()
    async def codebrain_status() -> str:
        """Report which Ollama models are available locally.
    
        Call this to verify the local backend is reachable and discover
        which models the user has pulled.
        """
        try:
            models = await list_models()
        except BackendError as exc:
            return f"[codebrain error] {exc}"
        if not models:
            return "No models installed. Run `ollama pull qwen2.5-coder:14b` to add the default."
        return "Installed models:\n" + "\n".join(f"  - {m}" for m in models)
  • The @mcp.tool() decorator registers 'codebrain_status' as an MCP tool on the FastMCP server instance.
    @mcp.tool()
  • The list_models() helper function that queries Ollama's /api/tags endpoint and returns a list of installed model names.
    async def list_models() -> list[str]:
        """List models currently installed in the local Ollama."""
        try:
            async with httpx.AsyncClient(timeout=10.0) as client:
                response = await client.get(f"{OLLAMA_URL}/api/tags")
                response.raise_for_status()
                return [m["name"] for m in response.json().get("models", [])]
        except httpx.ConnectError as exc:
            raise BackendError(
                f"Cannot reach Ollama at {OLLAMA_URL} — is `ollama serve` running?"
            ) from exc
  • Docstring serves as the tool's schema/description; the function takes no arguments and returns a string.
    async def codebrain_status() -> str:
        """Report which Ollama models are available locally.
    
        Call this to verify the local backend is reachable and discover
        which models the user has pulled.
        """
Behavior4/5

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

No annotations provided, but the description indicates a read-only check (report models, verify backend). Does not mention side effects or permissions, but the simple nature of the tool makes this sufficient.

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?

Two sentences, 24 words total. Every word adds value. Front-loaded with action ('Report...') followed by usage advice. No wasted text.

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, parameterless status tool with an output schema, the description provides the essential purpose and usage context. It is complete enough for an agent to decide when to call it among siblings.

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

Parameters4/5

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

No parameters in input schema, so description does not need to add parameter info. Schema coverage is 100% (empty). Baseline score of 4 is appropriate.

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

Purpose5/5

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

Clearly states it reports locally available Ollama models and can verify backend reachability. Differentiates from sibling tools like codebrain_generate (which generate responses) and codebrain_init (which sets up context).

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

Usage Guidelines4/5

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

Explicitly tells the agent to call this to verify backend reachability and discover pulled models. Provides clear context for when to use it, though no mention of when not to use or alternatives.

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

Install Server

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/Tschonsen/CodeBrain'

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