Skip to main content
Glama

configure_llm

Selects a project's LLM profile and embedding model, writes them to the gitignored local config, and tests the setup by making an API call; restores the previous config if the test fails.

Instructions

Select the LLM profile (and the embedding model) of the current project.

Writes to <project>/.fw-context/local.toml ONLY (gitignored, per-developer). Does NOT modify the global config or the shared project config.toml. The profiles themselves are in the global config, and only the operator writes them (fw-context llm setup or fw-context init): this tool takes no URL and no API key. After writing, tests the configuration by making a simple API call (skipped when LLM is disabled). When the test fails, the previous local.toml is restored and status is "error". A call with no change returns "error" and writes nothing.

WHY no URL and no key here (since the profiles, 2026-10-20): a key that an MCP call writes passes through the conversation of the LLM client, and a URL that a tool call sets can send the source code to any host.

Args: project_root: Project root directory. Auto-detected if omitted. project: Project name or project_id — call list_projects to get them. Use it to ask about a project that is not the project of the current directory. It is an alternative to project_root, which takes a root path. Give one of the two, not both. profile: The name of a profile of the global config. embed_model: Embedding model: an Ollama tag, a sentence-transformers name (BAAI/..., needs the st extra), or ft://.

Returns: dict: {status ("ok"|"error"), profile (str), provider (str), chat_api (dict — configured, endpoint, format, model), model (str), auto_pull (bool), stream (bool), context (int, for a profile of an API or of the ChatGPT plan: the context of the model in tokens), test_latency_s (float, on success), test_response (str, on success), compliance_warning (str, when the chat goes to another host), message (str)}

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "configure_llm"
  }
}

Input Schema

NameRequiredDescriptionDefault
profileNoThe LLM profile of this project: the name of a [llm.profiles.<name>] table of the global config (~/.fw-context/config.toml). None = keep the current profile. A project selects an external profile (an API, the ChatGPT plan, a cloud model of Ollama) or the Ollama profile of this machine; another Ollama profile gives an error. WARNING: a profile whose server is not this machine sends source code to that host.
projectNoProject name or project_id — call list_projects to get them. Use it to ask about a project that is not the project of the current directory. It is an alternative to project_root, which takes a root path. Give one of the two, not both.
embed_modelNoEmbedding model: an Ollama tag, a sentence-transformers name (e.g. 'BAAI/bge-small-en-v1.5'), or 'ft://latest'. None = keep current.
project_rootNoProject root. Auto-detected if omitted. This field also accepts a project name or a project_id, but project is the clear field for those.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.36.0
    • removedInput schema / properties / auto_pull
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "boolean"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Auto-pull models on 404 (Ollama only). False for intranet. None = keep current.",
      -  "title": "Auto Pull"
      -}
    • removedInput schema / properties / chat_api_base
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Chat API URL. None = use local Ollama for chat. Auto-detects format: :11434 or /api/generate -> Ollama, /v1 or bare host -> OpenAI-compatible. Examples: 'https://api.deepseek.com/v1' (DeepSeek), 'http://localhost:4000' (LiteLLM), 'http://localhost:8080/v1' (llama.cpp). WARNING: external URLs send source code to that host.",
      -  "title": "Chat Api Base"
      -}
    • removedInput schema / properties / chat_api_format
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Format override: 'ollama' or 'openai'; 'auto' returns to detection from the URL. None = keep current.",
      -  "title": "Chat Api Format"
      -}
    • removedInput schema / properties / chat_api_key
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "API key for cloud/proxy APIs. None for local/no-auth.",
      -  "title": "Chat Api Key"
      -}
    • removedInput schema / properties / model
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Chat model name. None = keep current.",
      -  "title": "Model"
      -}
    • addedInput schema / properties / profile
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "The LLM profile of this project: the name of a [llm.profiles.<name>] table of the global config (~/.fw-context/config.toml). None = keep the current profile. A project selects an external profile (an API, the ChatGPT plan, a cloud model of Ollama) or the Ollama profile of this machine; another Ollama profile gives an error. WARNING: a profile whose server is not this machine sends source code to that host.",
      +  "title": "Profile"
      +}
    • removedInput schema / properties / stream
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "boolean"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Stream chat responses via SSE (both OpenAI-compatible and Ollama-native). True = send stream:true, consume SSE chunks — avoids reverse-proxy idle timeouts (nginx 60s, Cloudflare 100s). None = keep current setting.",
      -  "title": "Stream"
      -}
  2. Changed9 schema fields changedv0.32.1
    • addedInput schema / properties / auto_pull / anyOf
      Added value: +[
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / auto_pull / default
      Previous value: -falseNew value: +null
    • changedInput schema / properties / auto_pull / description
      Previous value: -"Auto-pull models on 404 (Ollama only). False for intranet."New value: +"Auto-pull models on 404 (Ollama only). False for intranet. None = keep current."
    • removedInput schema / properties / auto_pull / type
      Removed value: -"boolean"
    • addedInput schema / properties / chat_api_format / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / chat_api_format / default
      Previous value: -"auto"New value: +null
    • changedInput schema / properties / chat_api_format / description
      Previous value: -"Format override: 'auto' (default), 'ollama', or 'openai'."New value: +"Format override: 'ollama' or 'openai'; 'auto' returns to detection from the URL. None = keep current."
    • removedInput schema / properties / chat_api_format / type
      Removed value: -"string"
    • changedInput schema / properties / embed_model / description
      Previous value: -"Embedding model name (Ollama only). None = keep current."New value: +"Embedding model: an Ollama tag, a sentence-transformers name (e.g. 'BAAI/bge-small-en-v1.5'), or 'ft://latest'. None = keep current."
  3. Changed3 schema fields changedv0.30.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / project
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Project name or project_id — call list_projects to get them. Use it to ask about a project that is not the project of the current directory. It is an alternative to project_root, which takes a root path. Give one of the two, not both.",
      +  "title": "Project"
      +}
    • changedInput schema / properties / project_root / description
      Previous value: -"Project root. Auto-detected if omitted."New value: +"Project root. Auto-detected if omitted. This field also accepts a project name or a project_id, but project is the clear field for those."
  4. Addedv0.25.3

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does it well: exact write target (.fw-context/local.toml, gitignored), explicit statement that global config and shared config.toml are untouched, the post-write API test, rollback of the previous file on failure, and the no-change error path. It even discloses that no URL or API key is accepted and why, plus a compliance_warning when chat leaves the host.

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

Conciseness3/5

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

The behavioral prose is front-loaded and tight, but the 'Args:' block duplicates the input schema nearly verbatim, and the dated 'WHY no URL and no key here (since the profiles, 2026-10-20)' aside is rationale that could be one line. Roughly a third of the text could be cut without losing decision-relevant information.

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

Completeness5/5

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

For a mutation tool with no annotations and no output schema, everything an agent needs is present: scope of the write, failure and rollback semantics, and a fully enumerated return dict including status, test fields and compliance_warning.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds useful semantics beyond it: what a profile name refers to (a table of the global config), the accepted embed_model forms, and the error case when two Ollama profiles conflict. The Args block largely restates the schema, which holds it back from a 5.

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?

Opens with a specific verb and resource: 'Select the LLM profile (and the embedding model) of the current project.' Nothing else in the sibling list does this, so the agent can place it immediately without opening the schema.

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?

States the selection context, tells the agent to call list_projects for names, and clarifies the project-vs-project_root choice ('give one of the two, not both'). It also implies the exclusions — profiles are created only by the operator via `fw-context llm setup`/`init`, so this tool cannot define them — without stating that as an explicit 'do not use for X' rule.

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