StackMemory

MCP Tools Reference

56 tools across 16 categories. All available via MCP protocol in Claude Code, Codex, and OpenCode.

Context Management

Core tools for reading and writing project context.

get_context

Get current project context and active frame information.

Params: query?: string limit?: number

add_decision

Record a decision, constraint, or important information.

Params: content: string type: "decision" | "constraint" | "learning"

start_frame

Start a new frame (task/subtask) on the call stack.

Params: name: string type?: "task" | "subtask" | "tool_scope" | "review" | "write" | "debug"

close_frame

Close current or specified frame with optional summary.

Params: frameId?: string summary?: string

add_anchor

Add an important fact or decision anchor to current frame.

Params: type: "FACT" | "DECISION" | "CONSTRAINT" | "INTERFACE_CONTRACT" | "TODO" | "RISK" text: string priority?: 1-10

get_hot_stack

Get current hot stack of active frames.

Params: max_events?: number

Task Management

Create, track, and analyze tasks within your project.

create_task

Create a new task with optional priority, tags, and parent.

Params: title: string priority?: "low" | "medium" | "high" | "critical" tags?: string[]

update_task_status

Update task status and progress percentage.

Params: task_id: string status: "pending" | "in-progress" | "blocked" | "completed" | "cancelled"

get_active_tasks

Get active tasks with filtering by status, priority, tags, or search.

get_task_metrics

Get task analytics — completion rates, velocity, and distribution.

Linear Integration

Bidirectional sync with Linear for issue tracking.

linear_sync

Sync tasks with Linear issues. Supports both, from_linear, or to_linear directions.

linear_update_task

Update a Linear issue directly — status, assignee, priority, labels.

linear_get_tasks

Get issues from Linear with filtering by team, assignee, state, or search.

linear_status

Get Linear integration status — connection health, sync state, last sync time.

Traces & Debugging

Execution traces, statistics, and lifecycle management.

get_traces

Get execution traces with optional filtering. Set analyze=true to run pattern analysis (performance, patterns, errors) instead of listing traces.

Params: limit?: number pattern?: string analyze?: boolean analysis_type?: "performance" | "patterns" | "errors"

get_trace_statistics

Get statistics about detected traces.

flush_traces

Flush any pending trace and finalize detection.

compress_old_traces

Compress traces older than specified hours.

Params: ageHours?: number

Discovery & Search

Find relevant files and search across all project context.

sm_discover

Discover relevant files based on current context. Extracts keywords from active frames and searches codebase.

sm_related_files

Find files related to a specific file or concept. Maps dependencies and connections.

sm_session_summary

Get a summary of the current session — active tasks, recent files, decisions made.

sm_search

Search across all StackMemory context — frames, events, decisions, and tasks.

Edit

Fuzzy file editing as a fallback for whitespace mismatches.

sm_edit

Fuzzy file edit with four-tier matching: exact, whitespace-normalized, indentation-insensitive, and line-level fuzzy (Levenshtein). Fallback when the editor's built-in edit fails.

Params: file_path: string old_string: string new_string: string threshold?: number

Cord Orchestration

Task decomposition with context scoping for multi-agent workflows.

cord_spawn

Create a subtask with clean context (spawn). Child sees only its prompt and completed blocker results.

Params: goal: string prompt?: string blocked_by?: string[] parent_id?: string

cord_fork

Create a subtask with full sibling context (fork). Child sees blocker results AND completed sibling results.

Params: goal: string prompt?: string blocked_by?: string[] parent_id?: string

cord_complete

Mark a cord task as completed with a result. Automatically unblocks dependent tasks.

Params: task_id: string result: string

cord_ask

Create an ask task — a question that needs an answer before dependent tasks can proceed.

Params: question: string options?: string[] parent_id?: string

cord_tree

View the cord task tree. Shows active, blocked, and completed tasks with context scoping.

Params: task_id?: string include_results?: boolean

Team Collaboration

Multi-agent context sharing across sessions and teammates.

team_context_get

Get context from other agents working on the same project. Returns recent frames and shared anchors from other sessions.

Params: limit?: number types?: string[] since?: number

team_context_share

Share a piece of context with other agents. Creates a high-priority anchor visible to team_context_get.

Params: content: string type?: "FACT" | "DECISION" | "CONSTRAINT" | "INTERFACE_CONTRACT" | "TODO" | "RISK" priority?: 1-10

team_search

Search across all agents' context in the project using full-text search.

Params: query: string limit?: number include_events?: boolean

Digest

Generate chronological activity summaries for time periods.

sm_digest

Generate a chronological activity digest for a time period.

Params: period: "today" | "yesterday" | "week"

Planning & Orchestration

Generate implementation plans and delegate execution to Claude or Codex with approval gates.

plan_only

Generate an implementation plan (Claude) and return JSON only.

Params: task: string plannerModel?: string

call_codex

Invoke Codex via codex-sm with a prompt and args; dry-run by default.

Params: prompt: string args?: string[] execute?: boolean

call_claude

Invoke Claude with a prompt (Anthropic SDK).

Params: prompt: string model?: string system?: string

plan_gate

Phase 1: Generate a plan and return an approvalId for later execution.

Params: task: string plannerModel?: string

approve_plan

Phase 2: Execute a previously generated plan by approvalId.

Params: approvalId: string implementer?: "codex" | "claude" maxIters?: number execute?: boolean

Pending Approvals

Manage approval-gated plans awaiting execution.

pending_list

List pending approval-gated plans with optional filtering by task content, age, and sort order.

Params: taskContains?: string olderThanMs?: number newerThanMs?: number sort?: "asc" | "desc" limit?: number

pending_clear

Clear pending approval-gated plans by id, all, or by age threshold.

Params: approvalId?: string all?: boolean olderThanMs?: number

pending_show

Show a pending plan by approvalId.

Params: approvalId: string

Smart Context

LLM-driven intelligent context retrieval and compressed summaries.

smart_context

LLM-driven context retrieval — intelligently selects relevant frames based on a natural language query.

Params: query: string tokenBudget?: number forceRefresh?: boolean

get_summary

Get compressed summary of project memory for analysis.

Params: forceRefresh?: boolean

Provider & Delegation

Route prompts to multiple LLM providers with smart cost-based routing and batch processing.

delegate_to_model

Route a prompt to a specific provider/model. Uses smart cost-based routing by default.

Params: prompt: string provider?: "anthropic" | "cerebras" | "deepinfra" | "openai" | "openrouter" model?: string taskType?: "linting" | "context" | "code" | "testing" | "review" | "plan"

batch_submit

Submit prompts to Anthropic Batch API (50% discount, async).

Params: prompts: {id, prompt, model?, maxTokens?, system?}[] description?: string

batch_check

Check status or retrieve results for a batch job.

Params: batchId: string retrieve?: boolean

DiffMem User Memory

Persistent user knowledge, preferences, and learned patterns across sessions.

diffmem_get_user_context

Fetch user knowledge and preferences from memory. Use to personalize responses.

Params: categories?: ("preference" | "expertise" | "project_knowledge" | "pattern" | "correction")[] limit?: number

diffmem_store_learning

Store a new insight about the user (preference, expertise, pattern, or correction).

Params: content: string category: "preference" | "expertise" | "project_knowledge" | "pattern" | "correction" confidence?: number (0-1)

diffmem_search

Semantic search across user memories. Find relevant past insights and preferences.

Params: query: string timeRange?: "day" | "week" | "month" | "all" minConfidence?: number (0-1) limit?: number

diffmem_status

Check DiffMem connection status and memory statistics.

Greptile Code Review

AI-powered code review integration with PR comments, patterns, and review triggering.

greptile_pr_comments

Get PR review comments from Greptile. Returns unaddressed comments with suggested code.

Params: name: string remote: "github" | "gitlab" | "azure" | "bitbucket" defaultBranch: string prNumber: number

greptile_pr_details

Get detailed PR information including metadata, statistics, and review analysis.

Params: name: string remote: string defaultBranch: string prNumber: number

greptile_list_prs

List pull requests. Filter by repository, branch, author, or state.

Params: name?: string sourceBranch?: string authorLogin?: string state?: "open" | "closed" | "merged"

greptile_trigger_review

Trigger a Greptile code review for a pull request.

Params: name: string remote: string prNumber: number branch?: string

greptile_search_patterns

Search custom coding patterns and instructions in Greptile.

Params: query: string limit?: number

greptile_create_pattern

Create a new custom coding pattern or instruction in Greptile.

Params: body: string type?: "CUSTOM_INSTRUCTION" | "PATTERN" scopes?: object

greptile_status

Check Greptile integration connection status.