Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
LLM_API_KEYNoThe API key for the LLM provider for enhanced LLM-powered analysis
LLM_PROVIDERNoThe LLM provider for enhanced LLM-powered analysis (e.g., 'openai' or 'anthropic')

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
context_healthA

[CONTEXT & STATE] 13 sub-tools: recap, conflict, ambiguity, verify, entropy, abstention, grounding, drift, depth, get_state, set_state, clear_state, history. Auto-selects based on params or use 'check' to override. TIP: context_loop runs all health checks automatically — prefer context_loop for comprehensive analysis, use context_health for targeted checks.

sandboxA

[SANDBOX] 3 sub-tools: discover (semantic tool search via TF-IDF), quarantine (isolated state sandbox), merge (merge/discard silo). Auto-selects based on params or use 'action' to override.

memoryB

[MEMORY] 6 sub-tools: store (hierarchical ingest), recall (adaptive gate retrieval), compact (compress with integrity), graph (knowledge graph with PageRank), inspect (tier status), curate (importance-based curation). Auto-selects based on params or use 'action' to override. TOOL NAME: memory (use underscores).

reasonA

[REASONING] 5 engines: inftythink (iterative bounded reasoning), coconut (multi-perspective latent analysis), extracot (reasoning chain compression), mindevolution (evolutionary search), kagthinker (structured logical decomposition with dependency DAG). Auto-selects based on params or use 'method' to override.

truthcheckA

[TRUTHFULNESS] 7 tools: probe (linguistic truth signals), truth_direction (truth vector projection), ncb (perturbation robustness), logic (formal logical consistency), verify_first (5-dimension verification), ioe (confidence-based correction), self_critique (iterative refinement). Auto-selects or use 'check' to override. Set cascade=true for auto-correction on low scores.

context_loopA

[ORCHESTRATOR — CALL THIS FIRST] CALL THIS TOOL every 2-3 turns and at the start of ANY task. It is the single most important tool — it replaces calling recap, conflict, ambiguity, entropy, grounding, drift, depth, and discovery tools individually.

What it does: Runs ALL context health checks in one call. Auto-extracts facts from conversation, detects contradictions, checks answer quality, and tells you exactly what to do next.

Returns a 'directive' object with:

  • action: proceed | clarify | reset | abstain | deepen | verify

  • instruction: Plain English telling you what to do

  • contextHealth: 0-1 score

  • autoExtractedFacts: Key facts pulled from conversation

  • suggestedNextTools: What tools to call next

  • constraints: Machine-readable rules you must follow

ESSENTIAL for: research tasks, multi-step workflows, long conversations, preserving context across turns, knowledge management, and any task requiring memory or fact-checking.

Minimal call: { "messages": [{"role":"user","content":"","turn":1}] } — most fields have smart defaults.

research_pipelineA

[PIPELINE] RECOMMENDED for research tasks. Orchestrates all underlying Context-First layers through 6 phases (init→gather→review→analyze→verify→finalize). NEW: plan→draft→review→fix loop — like compile→test→fix in coding. Init generates a research outline (12+ sections). Each gather adds depth to one section with quality gate (25K char / 500 line min — multiple gathers per section expected). Review runs quality tests and identifies gaps. CRITICAL: Interleave web search and gather — after EACH search, IMMEDIATELY call gather with deeply written content. Do NOT batch searches. Each gather writes a file to disk. After sufficient gathers, call review to run quality tests. Fix failed sections by gathering again with metadata.targetSection=N. Coverage must reach 60% before analyze. Autonomous file writing is ALWAYS ON — files are written to disk during gather, analyze, and finalize phases. Provide outputDir to control destination, or let the pipeline auto-create a temp directory. Finalize works even if verify hasn't passed. It does not browse the web or invent source material for you; use it to structure, preserve, pressure-test, and export sourced findings collected from web, GitHub, fetch, or other MCP tools.

export_research_filesA

[EXPORT] Automatically writes research artifacts to disk. It can expand and write every verified report chunk without asking the LLM to loop finalize manually, and it can also write every gathered raw-evidence batch even when verify has not passed yet.

Prompts

Interactive templates invoked by user choice

NameDescription
context-first-protocolLoad the Context-First execution protocol. Call this at the start of any session to understand how to use context_loop and memory tools effectively.
research-protocolOptimized protocol for deep research tasks. 6-phase outline-driven workflow with quality gates, coverage tracking, and review→fix loop.

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/XJTLUmedia/Context-First-MCP'

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