coding-os
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| cos_healthA | Return database health stats: row counts per table, schema version, DB size, FTS5 availability, embeddings status. Use this tool to verify the thinking_os database is operational and to get a quick summary of stored data volume. Returns: str: JSON object with keys: tables (row counts), schema_version, fts5_available, db_size_bytes, rag (embeddings + doc_chunks status). |
| cos_metric_recordA | Record a single agent performance metric after task completion. Args: agent_type: Type of agent (e.g. "general", "planner", "code-reviewer"). outcome: Result — one of: success, rework, partial, blocked. task_id: Task identifier (e.g. "TASK-143"). Optional. model: Model used (e.g. "sonnet", "opus"). Optional. duration_ms: Duration in milliseconds. Optional. domain: Task domain (e.g. "BACKEND", "FRONTEND", "INFRA"). Optional. complexity: Cynefin classification (e.g. "CLEAR", "COMPLICATED"). Optional. Returns: str: JSON with inserted row id and status. |
| cos_metric_queryA | Query agent metrics with optional filters. Args: domain: Filter by domain (e.g. "BACKEND"). Optional. model: Filter by model (e.g. "sonnet"). Optional. outcome: Filter by outcome (e.g. "rework"). Optional. agent_type: Filter by agent type. Optional. date_from: Start date (ISO format, e.g. "2026-03-01"). Optional. date_to: End date (ISO format, e.g. "2026-03-25"). Optional. limit: Max rows (1-100, default 20). Returns: str: JSON with total count and matching rows. |
| cos_metric_trendA | Get aggregated trend data for agent metrics. Args: metric: One of: success_rate, rework_rate, count. window_days: Lookback window in days (1-365, default 30). group_by: Grouping dimension: domain, model, agent_type, complexity. Returns: str: JSON with trends array containing period, counts, and rate. |
| cos_log_queryA | Query the durable log_events store (WARN+), most-recent first — the agent's "what is broken now". |
| cos_observation_recordD | Record an observation explicitly. |
| cos_searchA | Search observations and learned patterns with 5-signal ranking. Use during Orient step to find relevant past experience. Read-only over memory rows (writes retrieval telemetry only; reinforcement happens on cos_details, not here — TASK-109). Stage-1 metadata pre-filter:
Args:
query: Search text (e.g. "backend rework", "django migration").
limit: Max results (1-20, default 5).
memory_type: Filter by type (pattern/workflow/error/decision/discovery). Optional.
min_confidence: Drop learned_patterns with confidence below this
value (0.0-1.0). Default 0.3 (skips decayed noise). 0.0 = no filter.
since_days: Drop rows older than now- Returns: str: JSON with results list [{id, title, confidence, impact_score, memory_type, source_table}]. |
| cos_timelineA | Get recent task outcomes and observations timeline. Args: days: Lookback window (1-365, default 30). domain: Filter by domain (e.g. "BACKEND"). Optional. limit: Max entries (1-50, default 20). Returns: str: JSON with timeline entries [{id, title, date, outcome, type}]. |
| cos_detailsA | Get full details of a pattern, observation, or task outcome. Args: pattern_id: Row ID (or task_id string for task_outcomes). source: Table name — observations, learned_patterns, or task_outcomes. Returns: str: JSON with full record. |
| cos_promoteA | Promote a validated pattern to a rule or feedback memory file. Requires confidence >= 0.3. Creates file content but does NOT write to disk (caller writes the returned content to the appropriate location). Args: pattern_id: ID in learned_patterns table. target: Output type — "feedback" or "rule". Returns: str: JSON with status, filename, and file content to write. |
| cos_learn_extractA | Scan task outcomes to discover recurring patterns. Detects domain_rework, skill_correlation, and complexity_mismatch patterns. Inserts new patterns into learned_patterns with calculated confidence. Args: min_occurrences: Minimum occurrences to consider a pattern (default 3). Returns: str: JSON with extracted patterns list and analysis stats. |
| cos_learn_suggestA | Return relevant patterns for the current task context. Includes spaced repetition: fading patterns (0.2-0.4 confidence) that were once validated get priority for re-validation. Args: domain: Task domain (e.g. "BACKEND"). Optional. complexity: Cynefin classification. Optional. task_type: Type of task (e.g. "feat"). Optional. limit: Max suggestions (1-20, default 5). Returns: str: JSON with suggestions list [{id, pattern, confidence, reason}]. |
| cos_learn_validateA | Record whether a suggested pattern was helpful. Updates confidence using brain-inspired formulas:
Args: pattern_id: ID in learned_patterns table. was_helpful: Whether the pattern was useful (default True). Returns: str: JSON with old/new confidence and validation status. |
| cos_learn_narrativeA | Record what was learned from a difficult task (breakthrough narrative). Call this after a rework→success breakthrough to capture:
Creates a high-impact learned pattern for future suggestions. Args: task_id: Task identifier (e.g. "TASK-100"). what_failed: Approaches that didn't work. what_worked: The solution that resolved the issue. key_insight: Reusable lesson learned (required). Returns: str: JSON with status, history_id, pattern_id. |
| cos_route_modelA | Recommend optimal model based on historical outcome data. Cold start (<10 outcomes): returns static default from performance.md. Warm: queries success rates per model for the given complexity+domain. Args: complexity: Cynefin classification (CLEAR/COMPLICATED/COMPLEX/CHAOTIC). dimensions: Number of problem dimensions (default 1). domain: Task domain (e.g. "BACKEND"). Optional. Returns: str: JSON with recommended_model, confidence, reason, fallback_model. |
| cos_route_skillA | Recommend skills based on historical outcome data. Cold start: returns static defaults from skill-enforcement.md. Warm: augments with historically successful skills. Args: domain: Task domain (e.g. "BACKEND", "FRONTEND"). task_type: Type of task (e.g. "feat", "fix"). Optional. complexity: Cynefin classification. Optional. Returns: str: JSON with skills list [{name, confidence, reason}]. |
| cos_trajectory_snapshotA | Persist a project trajectory snapshot for the current session. Records WHERE the project is heading (phase, focus, architectural decisions, anti-patterns discovered, open questions) so future sessions have strategic context beyond task history. Each call creates a new row linked to the previous snapshot via supersedes_id. Args: session_id: Current session identifier. phase: Current development phase (e.g. "v2 hardening"). current_focus: What the team is focused on right now. architectural_decisions: JSON array of {decision, rationale} objects. anti_patterns_discovered: JSON array of {pattern, context} objects. open_questions: JSON array of {question, priority} objects or plain strings. next_logical_step: Single-sentence description of what comes next. confidence: Confidence in this trajectory assessment (0.0-1.0). Returns: JSON with {status, id, supersedes_id}. |
| cos_trajectory_readA | Return the most recent project trajectory snapshot(s). Use at session start to understand WHERE the project is heading before looking at the task board. Returns phase, current focus, architectural decisions made, anti-patterns discovered, and open questions. Args: limit: Number of recent snapshots to return (1-20, default 1). Returns: JSON with {snapshots: [...], count: int}. |
| cos_failure_pattern_queryA | Aggregate structured failure anatomy from backtrack_events. Returns which root_cause categories recur most frequently, with examples. Use before planning to avoid known failure modes. Requires migration v25 (structured backtrack anatomy columns). root_cause filter values: wrong_model | scope_too_large | missing_context | tool_failure | spec_ambiguity | env_mismatch | other Args: root_cause: Optional filter to a specific root cause category. domain: Reserved for future per-domain filtering. limit: Max pattern groups to return (1-50, default 10). Returns: JSON with {patterns: [{root_cause, count, examples}], total_structured, total_backtrack}. |
| cos_doc_searchA | Semantic + lexical search over project documentation chunks. Stage-1 metadata pre-filter (since migration v22):
Args:
query: Natural language search query (e.g. "commission rate calculation").
source_types: Optional comma-separated filter — restrict to specific
source types (e.g. "prd,architecture,adr"). Empty = all types.
limit: Maximum results (1-50, default 5).
mode: "auto" (default) | "semantic" | "lexical".
domain: Frontmatter Response meta carries Returns: str: JSON envelope with results list and count. Each result carries source_path, source_type, heading_path, content, score, priority, mtime, chunk_index, retrieval_source. |
| cos_doc_headerA | Return a single doc's header without reading the body. |
| cos_doc_headers_byB | Bulk header-only scan filtered by frontmatter. |
| cos_task_searchA | Semantic search over the task store with optional status/domain filters. Use this when you need to find tasks related to a concept — even when exact keywords don't match. Falls back to LIKE on title + goal when embeddings are unavailable. Args: query: Natural language query (e.g. "payment splitting multi vendor"). status: Optional status filter — one of open/wip/done/blocked. Empty = all. domain: Optional domain filter (BACKEND/FRONTEND/DOCS/INFRA/...). Empty = all. limit: Maximum results (1-100, default 10). Returns: JSON with results and count. Each result: task_id, title, domain, status, file_path, goal_text, dependencies, score. |
| cos_task_dependenciesA | Return the tasks that Use before starting a task to verify prerequisites are done. Returns only direct (first-level) dependencies — use repeated calls for transitive traversal. Args: task_id: Task identifier (e.g. "TASK-199"). Returns: JSON with task_id, dependencies list, and count. |
| cos_task_dependentsA | Return the tasks that declare Use for impact analysis: "If I change TASK-195, what downstream tasks need to be re-verified?" Returns only direct dependents — non-transitive. Args: task_id: Task identifier (e.g. "TASK-195"). Returns: JSON with task_id, dependents list, and count. |
| cos_task_by_filterA | List tasks matching an optional status and/or domain filter. No semantic query — pure structured filter. Use when you need "all open backend tasks" or "all blocked tasks" without a specific concept. Args: status: Filter by status (open/wip/done/blocked). Empty = all. domain: Filter by domain (BACKEND/FRONTEND/DOCS/...). Empty = all. limit: Maximum results (1-100, default 20). Returns: JSON with results list (sorted by task_id ASC) and count. |
| cos_task_createA | Create a new Scrumban task file + sync to DB. Prefer this over hand-writing YAML. Validates swimlane against scrumban-config.yaml and kind against the 8-value enum. Pass ready=True to mark the task pullable in one shot; for bug-kind tasks pass acceptance= (G/W/T lines) and repro= so the create satisfies its own DoR in one call. |
| cos_task_boardA | Return the board state grouped by (swimlane, status) with WIP info. Complete/archive columns are keyset-paginated (pass cursor + status_filter to load more). |
| cos_task_showA | Show a single task's frontmatter fields and full markdown body — in-session alternative to raw ls/grep/Read on docs/tasks. |
| cos_task_historyB | Full actor-attributed task history — creation, status transitions, field edits, and git commits. |
| cos_task_editA | Edit a task's frontmatter fields and/or body; each change is recorded to the actor-attributed edit history. |
| cos_task_linkA | Set a task's optional external_ref (e.g. github#42) — forge auto-detected; metadata only, never the id. |
| cos_presence_queryA | Return per-agent presence state and live-session inventory. Reads Used by |
| cos_task_moveC | Transition a task through the Scrumban state machine. |
| cos_task_repositionB | Update Scrumban status and/or swimlane (MD frontmatter + sync). |
| cos_task_readyA | Add or remove the 'ready' label that gates icebox→in_progress. |
| cos_task_reclaimC | Reclaim zombie in_progress tasks (idle + owner session inactive) to icebox+ready. |
| cos_task_reconcileA | Triage stranded in_progress/testing tasks with completion evidence + a review recommendation (read-only). |
| cos_task_pickB | Return top candidate tasks to start next, ranked by priority. |
| cos_task_claim_nextC | Atomically select+claim the top runnable task for this session (or claimed=null). |
| cos_task_dailyC | Produce the daily standup summary. |
| cos_task_retroB | Weekly retro metrics (cycle time, throughput, emergency count). |
| cos_task_wip_checkA | Lightweight check of current WIP counts vs. configured caps. |
| cos_work_log_appendB | Append one Work Log line to a task. Critical for Codex sessions. |
| cos_retrieval_citeA | Mark retrieval rows as actively cited by the agent. Call this after using one or more chunks/patterns/tasks in a meaningful way (read them carefully, applied them). Cited retrievals get ~4× the weight when priority-learning runs, so the signal is only useful if it reflects actual use — do NOT cite passive retrievals. Args:
retrieval_ids: Comma-separated list of retrieval ids (int), returned
as Returns:
JSON with |
| cos_retrieval_learnA | Adjust document_chunks.priority based on recent retrieval outcomes. Walks retrievals with a known outcome in the lookback window and:
Clamped to [0.1, 0.9]. Intended to run nightly via cron or after a batch of task-done events. Args: lookback_days: How many days of retrievals to consider (default 7). dry_run: When True, compute changes without writing. Returns:
|
| cos_digest_regenerateA | Refresh The digest is a ≤ 2.4 KB rolling snapshot of the agent's identity: active beliefs, fading patterns, recent breakthroughs, preferences. Session-startup reads this file to give the agent a coherent memory anchor before any retrieval fires. Args: project_root: Override project root. Empty (default) uses cwd. Returns:
|
| cos_retrieval_qualityA | Report mean retrieval precision over the lookback window. Precision is derived from (was_cited, outcome) pairs on the retrievals table, so it's honest: a retrieval that was cited and led to success counts as 1.0; a cited retrieval that led to rework counts as 0.0. Used to decide whether contextual enrichment is worth the LLM cost. Args: lookback_days: Window in days (default 14). layer: Optional layer filter ("memory"|"docs"|"tasks"). Returns:
|
| cos_retrieval_enrichment_checkA | Recommend whether to enable contextual retrieval enrichment. The underlying LLM enrichment path is intentionally a stub — this tool exists so the decision is metric-driven and auditable before anyone pays the Haiku bill. Args: lookback_days: Window of retrieval quality data (default 14). Returns:
|
| cos_superviseA | Return the next action the main agent should take: dispatch a formula-agent, backtrack, or signal done. Call repeatedly after recording each formula output via cos_supervise_record_output. Never spawns agents itself — only tells the main agent what to dispatch. |
| cos_supervise_record_outputA | Append a formula-agent's output to the session EvidenceBundle and record the dispatch in formula_dispatches. Call after each formula-agent returns. status: ok|fail|timeout. |
| cos_dispatch_formulaA | Return the rendered agent prompt and input slice for a formula-agent. The main agent uses this to construct the subagent dispatch. Does NOT spawn the subagent — returns prompt text only. |
| cos_ambiguity_checkA | Run the 7-criteria Anti-Ambiguity gate over the session EvidenceBundle. Returns violations (formula, criterion, detail). Empty list = gate passes. Fires once at PLAN→EXECUTE; CLEAR 1 tasks skip this check. |
| cos_traceabilityA | Read-only audit: verify that tasks have doc anchors and that recent formula dispatches have matching evidence in the bundle. Idempotent and non-blocking. scope: task|project. |
| cos_backtrack_logB | Record a backtrack event. Returns {count, advisory, suggested_action, root_cause_summary}. advisory fires at ≥3/≥5 backtracks. suggested_action gives a concrete next step when root_cause is supplied. root_cause_summary shows per-cause counts for this session. |
| cos_discoveryB | Capture a mid-work discovery. decision=backtrack_now triggers an immediate backtrack recommendation. decision=record_for_later stores the discovery for session summary review. |
| cos_situation_detectB | Classify a set of signals into a situational dispatch chain id (incident-response, onboarding, scope-change, external-integration, design-review, existing-project-takeover) or null if none match. The matched situation overrides persona primary_formulas. |
| cos_takeoverA | Bootstrap an existing-project-takeover session: sets the situation to existing-project-takeover, picks legacy-maintainer persona, and returns the first dispatch action (Analyst in reverse mode). Use when inheriting a legacy repo with no docs. |
| cos_analyze_taskA | Extract TaskSignals (domain, action, novelty, urgency, scope, external_dependency, is_takeover, breaking_change, ...) from a prompt + optional memory/graph context. Replaces persona keyword matching. Under 500ms; cached per task_marker. |
| cos_compose_chainA | Compose an ordered formula-role chain from TaskSignals. Strategy: situation override > preset match > per-role scoring composer > hard fallback. Returns ComposedChain with provenance (preset_id, preset_version, effective_threshold, activations). |
| cos_role_infoA | Return metadata for a formula-role (researcher..refactorer): prompt_prefix, tools_budget, intensity_steps, backtrack_triggers, criteria_required. Useful for the main agent before dispatch. |
| cos_dispatch_formula_runA | EXPLICIT, OPT-IN sub-agent spawn for one role. Costs ~5k tokens per call (system prompt + input slice + completion) and rebuilds context inside the sub-agent. PREFER lazy-loading: read src/core/thinking_os/agents/.md inline and produce the output schema yourself — same accuracy, far fewer tokens, no context rebuild penalty. Use this tool only when (a) the role's work is long-running and would dominate the main loop, or (b) you explicitly want a separate session for parallelism. If no SDK is available, returns status='skipped' and the main agent should execute the role's procedure inline. |
| cos_dispatch_parallel_runA | Spawn multiple formula-agents concurrently via asyncio.gather. Use when the supervisor returns action='dispatch_parallel' (e.g. security_auditor layers). Each output is persisted to the bundle. Returns list of DispatchResults in input order. |
| cos_classify_promptA | Heuristic Cynefin + dimensions classifier. Reads a user prompt and returns {complexity, dimensions, reasoning, signals}. Optionally writes the gate marker so enforce-task-start.sh passes. Replaces the manual |
| cos_graph_queryA | Look up a symbol by a KNOWN short term, path, or uid (lexical + graph expansion). For a natural-language DESCRIPTION of code whose name you don't know, use cos_graph_search instead. TIP: prefer SHORT terms ("sdk_dispatcher", "ClaudeSDKDispatcher.dispatch") or a literal path / uid. Long natural-language queries return weaker matches because the index is built from labels + docstrings, not free text. UID scheme (also accepted as When the query looks like a path or uid and the lexical pass returns nothing, the tool falls back to a direct uid lookup so the agent gets a single-item hit instead of empty results. Args: q: Short term, path, or uid (non-empty). NL queries work but degrade. kinds: Comma-separated filter of node kinds (e.g. "function,class,method"). Empty = all. limit: Max results (default 10). max_hops: Walk expansion depth (default 2). confidence_min: Edge confidence floor (default 0.3). include_spine: S3 — attach the CONTAINS-ancestor chain to each result for breadcrumbs. Returns:
JSON envelope with |
| cos_graph_contextA | Return callers + callees + siblings + referenced docs around a symbol. Args:
uid_or_name: Node uid or fuzzy label. Uid scheme:
|
| cos_graph_impactA | Group affected nodes by risk tier (will_break / should_review / context). Args:
uid: Fully-qualified node uid. Scheme: |
| cos_graph_detect_changesA | Map changed files to affected symbols + downstream tasks + risk level. Args: files: Comma-separated file paths (empty → echo empty envelope). scope: Label only; "working" | "staged" | "HEAD~1..HEAD". analyze_downstream: Walk transitive blast radius. |
| cos_graph_traceA | Forward execution walk from Args:
entry_uid: Function/method uid to start from, e.g.
|
| cos_graph_similarA | Return the top-K nodes most similar to Args:
uid: Fully-qualified node uid (see |
| cos_graph_searchA | Find code symbols from a NATURAL-LANGUAGE description (semantic + lexical + centrality). For a KNOWN name / path / uid, use cos_graph_query instead. Args: query: Natural-language or code-ish query (e.g. "validate jwt token"). top_k: Number of results to return (1–50). |
| cos_graph_referencesA | List inbound edges — "who references this?". Args:
uid: Fully-qualified node uid. Scheme: |
| cos_graph_pathA | Shortest path between two nodes (either direction). Args:
source_uid: Origin uid (auto-resolves raw paths; see
|
| cos_graph_exportA | Export a subgraph as json | mermaid | dot. Args:
format: Output format ( |
| cos_graph_rename_planA | Plan a rename — call-sites, docs, tests, strings, risk. Args:
uid: Symbol to rename. Scheme: |
| cos_graph_contractsB | Enumerate every handler declared in the graph (HTTP / MCP / gRPC / events / WS). |
| cos_graph_entrypointsC | Top-N scored entry points (main / cli / http / cron / test) — TASK-081. |
| cos_graph_communitiesD | Louvain process clusters — response key is |
| cos_graph_resolveA | Resolve a natural-language label, path, or partial uid to canonical uids. Use this BEFORE other cos_graph_* tools when you don't know the exact uid. Tries: direct uid → path/qualname → FTS5 full-text → LIKE fallback. UID scheme: code:file: · code:function::: · code:class::: code:method:::. · code:module: doc:file: · doc:heading:#: · folder: Args: q: Natural language ("the dispatcher function"), label ("ClaudeSDKDispatcher"), path ("adapters/claude/sdk_dispatcher.py"), or qualname ("Class.method"). kinds: Comma-separated kind filter (e.g. "function,method,class"). Empty = all. top: Max results (default 10). Returns:
JSON envelope with |
| cos_graph_centralityA | Hub detection — surface high-degree (or high-betweenness) nodes. Use to identify chokepoints / refactor priorities / nodes that demand extra review. Args: metric: "degree" (cheap, default) or "betweenness" (expensive). top: Max nodes returned (default 20). kind: Optional kind filter (e.g. "function", "class"). Empty = all. Returns:
JSON envelope with |
| cos_graph_rankingA | PageRank — node importance, optionally personalised by query. Use for: knowledge condensation (top-N canonical concepts), query-personalised search ranking, documentation sourcing. Args: query: Optional personalisation query ("auth", "graph backend"). Empty = global PageRank. top: Max nodes returned (default 20). kind: Optional kind filter. Empty = all. damping: PageRank damping factor (default 0.85). iterations: Power-iteration count (default 30). Returns:
JSON envelope with |
| cos_graph_cyclesA | Detect circular dependencies as strongly-connected components. Args: scope: "imports" (module-level circular deps, the design smell) or "calls" (function cycles incl. legitimate mutual recursion). top: Max cycles returned (default 20). min_size: Minimum SCC size to report (default 2). Returns:
JSON envelope with |
| cos_graph_dead_codeA | List in-repo symbols with zero non-test inbound references (dead-code candidates). Surfaces functions / methods / classes that nothing (outside tests) calls, constructs, subclasses, or type-references — the inverse of centrality. Candidates only: dynamic-dispatch / CLI-registered / externally-called symbols may appear; verify with cos_graph_references before deleting. Args: kind: Optional filter — function | method | class. Empty = all three. top: Max candidates returned (default 50, max 500). include_tests: Count test-sourced edges + include test files (default False). Returns:
JSON envelope with |
| cos_graph_test_gapA | List prod function/method/class with zero inbound edge from any test (untested symbols). Candidates only: indirect exercise (CLI / fixtures / dynamic dispatch) may not appear as a graph edge. Shell excluded (no call-graph). Args: kind: Optional filter — function | method | class. Empty = all three. top: Max returned (default 50, max 500). Returns:
JSON envelope with |
| cos_graph_diffA | Graph blast-radius of a git revision range (base..head). Resolves changed files via Args: base: Base git revision (default HEAD~1). head: Head git revision (default HEAD). analyze_downstream: Walk transitive consumers (default True). Returns: JSON envelope with range, files, symbols, downstream_consumers, risk_level. |
| cos_graph_doctorA | Graph health snapshot — orphans, dangling edges, duplicates, backend status. Call when graph queries return nothing or Args: fix: If True, attempt safe repairs (delete dangling edges). Default False — use the report-only mode to see what would change first. Returns:
JSON envelope with |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/kouroshez/coding-os'
If you have feedback or need assistance with the MCP directory API, please join our Discord server