Skip to main content
Glama

Query Local AI service

query_local_ai_service

Query an allow-listed Local AI HTTP API path for reads and chat, returning JSON from the local network. Send GET or POST requests to endpoints like /api/tags or /v1/chat/completions.

Instructions

Call the Local AI (Ollama-compatible) HTTP API on an allow-list of read and chat paths. Use install_model to pull and set_model_settings to create a variant. Pull and create are refused here. Talks to the local network. Returns JSON with the API body or an allow-list error.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "endpoint": "<endpoint>"
    },
    "name": "query_local_ai_service"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataNoJSON body for POST. Omit for GET.
methodNoHTTP method. GET or POST. Default GET.GET
endpointYesAPI path such as /api/tags or /v1/chat/completions. Leading slash optional. No query string.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv6.2.1
    • addedInput schema / properties / data / description
      Added value: +"JSON body for POST. Omit for GET."
    • addedInput schema / properties / endpoint / description
      Added value: +"API path such as /api/tags or /v1/chat/completions. Leading slash optional. No query string."
    • addedInput schema / properties / method / description
      Added value: +"HTTP method. GET or POST. Default GET."
  2. First observedv5.0.0

TDQS

A4.3/5.0
Behavior4/5

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

Adds real context beyond the annotations: an allow-list gate, refusal semantics for pull/create, local-network exposure (reinforcing openWorldHint), and the shape of the result including error behavior. It does not spell out which chat paths can mutate server state, which matters given readOnlyHint=false.

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

Conciseness4/5

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

Front-loaded with the core action and scope, and every sentence carries routing or constraint information. 'Talks to the local network' is slightly redundant with openWorldHint=true, and the telegraphed phrasing ('Pull and create are refused here') is terse to the point of slight opacity.

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?

With an output schema present, return values need not be detailed, and the description still summarizes them. The remaining gap is that the allow-list itself is not enumerated, so an agent must discover permitted paths by trial or error response.

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

Parameters3/5

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

Schema description coverage is 100%, so endpoint, method, and data are already fully documented with usage notes (GET/POST, leading slash, no query string). The description adds no parameter-level detail beyond that, so the baseline 3 applies.

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?

States a specific verb and resource ('Call the Local AI (Ollama-compatible) HTTP API') and immediately bounds the scope to an allow-list of read and chat paths. It explicitly distinguishes itself from siblings install_model and set_model_settings by naming what is refused here.

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

Usage Guidelines5/5

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

Names the concrete alternatives for the excluded operations ('Use install_model to pull and set_model_settings to create a variant') and states the exclusion rule ('Pull and create are refused here'). An agent knows exactly when to route elsewhere.

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