Skip to main content

Gofer - API Reference

Executive Summary

Gofer exposes three API surfaces:

  1. Model Context Protocol (MCP) Tools - 23+ tools for AI assistants to manage specs, tasks, memory, and context
  2. Language Server Protocol (LSP) Methods - Custom LSP methods for extension-to-server communication
  3. VS Code Extension Commands - 75+ commands registered in VS Code command palette

All APIs use JSON for request/response payloads and follow error handling conventions with typed error codes.

Model Context Protocol (MCP) Tools

MCP tools are exposed via the language server and callable by Claude Code, GitHub Copilot, and other MCP-compatible AI assistants. Tools are invoked via LSP custom request tools/call.

Tool Categories

  • Spec Management - List, read, and manage specifications
  • Task Execution - Query and execute implementation tasks
  • Validation - Code quality checks and test execution
  • Memory - Store and retrieve project knowledge
  • Context Management - Progressive context compaction and observation handling
  • Health & Diagnostics - Context health, slop detection, research chunking

Core MCP Tools

Tool NamePurposeRequired ParamsAuth
gofer_get_specsList all specsNoneNo
gofer_get_next_taskGet next available taskNoneNo
gofer_execute_taskExecute specific task with enriched contextspecId, taskIdNo
gofer_update_task_statusUpdate task statusspecId, taskId, statusNo
gofer_validate_codeValidate code qualityfilesNo
gofer_run_testsRun specification testsspecIdNo
gofer_expand_observationRetrieve full masked observationobservationIdNo
gofer_peek_observationGet observation summaryobservationIdNo
gofer_fold_observationMask observation to save contextobservationIdNo
gofer_grep_observationsSearch observationspatternNo
gofer_context_peekView context stateNoneNo
gofer_context_replInteractive context managementcommandNo
gofer_get_context_healthGet context health statusNoneNo
gofer_get_research_indexGet research chunk indexspecIdNo
gofer_load_research_chunkLoad specific research chunkspecId, chunkIdNo
gofer_trigger_handoffSave session checkpointspecIdNo
gofer_check_slopDetect code slopfilesNo

See detailed parameter schemas in language-server/src/server.ts (line 175+).

Language Server Protocol (LSP) Methods

Custom LSP methods for extension-to-server communication.

gofer/listSpecs

List all specifications in workspace.

Request:

{
"method": "gofer/listSpecs",
"params": {}
}

Response:

{
"specs": [...]
}

gofer/getSpec

Get a specific specification by ID.

Request:

{
"method": "gofer/getSpec",
"params": {
"specId": "001-login-feature"
}
}

Response:

{
"spec": {...}
}

gofer/updateProgress

Update progress for a spec/task (extension → server notification).

Notification:

{
"method": "gofer/updateProgress",
"params": {
"specId": "001-login-feature",
"taskId": "T001",
"status": "completed"
}
}

VS Code Extension Commands

Commands registered in the VS Code command palette (Cmd/Ctrl+Shift+P).

Repository Management

CommandTitleKeybindingDescription
gofer.initializeGofer: Initialize RepositoryCtrl+Shift+Alt+ICreate .specify/ folder structure
gofer.upgradeGofer: Upgrade to Gofer Format-Migrate from legacy format
gofer.fixSpecPathsGofer: Fix Spec Path References-Fix paths after migration

Specification Management

CommandTitleKeybindingDescription
gofer.openSpecGofer: Open Specification-Open spec file in editor
gofer.createSpecGofer: Create New Specification-Create new spec with template
gofer.showSpecDetailsGofer: Show Specification Details-Show spec metadata
gofer.refreshSpecsGofer: Refresh Specifications-Reload specs from disk

UI Panels

CommandTitleKeybindingDescription
gofer.showProgressGofer: Show Progress Panel-Show spec progress tree view
gofer.showAIUsageGofer: Show AI Usage Details-Show token usage and costs
gofer.showConstitutionGofer: Show Constitution Panel-Show project constitution
gofer.viewMemoriesGofer: View Memories-Show memory panel

Memory Management

CommandTitleKeybindingDescription
gofer.rememberGofer: Remember-Store new memory
gofer.searchMemoryGofer: Search Memory-Search memories by keyword
gofer.forgetMemoryGofer: Forget Memory-Delete specific memory
gofer.clearMemoryGofer: Clear Memory-Clear all memories (with confirmation)
gofer.queryMemoryUsageGofer: Query Memory Usage-Show memory stats
gofer.migrateMemoriesToLayeredGofer: Migrate Memories to Layered Format-Migrate to 3-layer memory system
gofer.viewCompactionHistoryGofer: View Compaction History-Show memory compaction log

Context Management

CommandTitleKeybindingDescription
gofer.refreshContextWindowGofer: Refresh Context Window-Refresh context health status
gofer.showContextCategoryContentGofer: Show Context Category Content-Show specific context category

Updates & Maintenance

CommandTitleKeybindingDescription
gofer.checkForUpdatesGofer: Check for Updates-Check for extension updates
gofer.updateNowGofer: Update Now-Download and install update
gofer.updateTemplatesGofer: Update Templates-Download latest templates

Developer Tools

CommandTitleKeybindingDescription
gofer.installOptionalToolsGofer: Install Optional Developer Tools-Install node-pty and other optional dependencies
gofer.createHintFileGofer: Create Hint File-Create implementation hint file

Error Handling

Error Response Format

All MCP tools return errors in the following format:

{
"success": false,
"error": "Human-readable error message",
"errorCode": "ERROR_CODE"
}

Common Error Codes

CodeDescriptionRecovery
SPEC_NOT_FOUNDSpecification not foundVerify specId exists in .specify/specs/
TASK_NOT_FOUNDTask not found in specificationVerify taskId exists in tasks.md
LOAD_ERRORFailed to load file from diskCheck file permissions and disk space
VALIDATION_ERRORInput validation failedCheck parameter types and required fields
SEARCH_ERRORSearch operation failedSimplify search query
MEMORY_LOAD_ERRORFailed to load memory storeCheck .specify/memory/ permissions
OBSERVATION_NOT_FOUNDObservation ID not foundVerify observation UUID is valid
NO_TASKS_AVAILABLENo tasks ready for executionCheck task dependencies and status

Rate Limiting

  • MCP Tools: No rate limiting (local execution)
  • Provider CLIs: Subject to provider and account limits:
    • Claude Code CLI: model route comes from .specify/memory/gofer-model-policy.yaml
    • Gemini CLI: model route comes from .specify/memory/gofer-model-policy.yaml
    • OpenAI Codex CLI: model route comes from .specify/memory/gofer-model-policy.yaml

Authentication

  • MCP Tools: No authentication required (local workspace only)
  • AI Providers: Use each provider CLI's login/session state. Environment variables such as ANTHROPIC_API_KEY or OPENAI_API_KEY are optional CLI fallback mechanisms only, not Gofer VS Code settings.

Versioning

  • Current Version: 3.4.0
  • API Stability: Experimental (MCP tools may change between minor versions)
  • Breaking Changes: Announced in CHANGELOG.md with migration guide
  • Deprecation Policy: 2 minor versions notice before removal

Usage Examples

Claude Code: Execute a Task

#gofer_execute_task specId="001-login-feature" taskId="T003"

GitHub Copilot: Query Specs

#gofer_get_specs

VS Code Extension: Refresh Progress

vscode.commands.executeCommand('gofer.refreshSpecs');

LSP Client: Update Task Status

await lspClient.sendRequest('gofer/updateProgress', {
specId: '001-login-feature',
taskId: 'T001',
status: 'completed',
});