Skip to main content
Glama
ARQAWA

code_nav MCP

by ARQAWA

code_nav.health

Read-only

Verify repository detection and navigation dependency health. Quickly identifies issues with repo recognition and dependency integrity.

Instructions

Check repo detection and code_nav dependency health.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'health' function that executes the tool logic — checks repo detection, dependencies (git, fff, probe, ast-grep, rg, rtk), config, and collects warnings.
    export async function health(cwd = process.cwd()) {
      const repo = await getRepoRoot(cwd);
      const config = await loadConfig(repo.repoRoot);
      const [git, probe, rg, rtk, astGrep, fff, gitGrep] = await Promise.all([
        commandVersion("git", ["--version"]),
        commandVersion("probe", ["--version"]),
        commandVersion("rg", ["--version"]),
        rtkStatus(),
        detectAstGrep(),
        getFffStatus(repo.repoRoot),
        runCommand("git", ["grep", "--help"], { cwd: repo.repoRoot }),
      ]);
      const warnings = [
        ...repo.warnings,
        ...config.warnings,
        ...(fff.warning ? [`fff: ${fff.warning}`] : []),
        ...(probe.ok ? [] : ["probe is not installed; extract_context will fallback"]),
        ...(astGrep.ok ? [] : ["ast-grep/sg is not installed; structural_search unavailable"]),
        ...(rg.ok ? [] : ["rg is not installed; exact_audit may use git grep"]),
        ...(rtk.ok ? [] : ["rtk is not installed; noisy-output helper unavailable"]),
      ];
      return {
        ok: git.ok,
        repo_root: repo.repoRoot,
        dependencies: {
          git: { ok: git.ok, version: git.version },
          git_grep: { ok: gitGrep.exitCode === 0 || gitGrep.exitCode === 129 },
          fff: { ok: fff.mode === "node", mode: fff.mode },
          probe: { ok: probe.ok, version: probe.version },
          ast_grep: {
            ok: astGrep.ok,
            command: astGrep.command,
            version: astGrep.version,
          },
          rg: { ok: rg.ok, version: rg.version },
          rtk: { ok: rtk.ok, version: rtk.version },
        },
        config: {
          mode: "auto",
          code_navrc: config.path,
        },
        warnings,
      };
    }
  • src/mcp.ts:20-28 (registration)
    Registration of the 'code_nav.health' tool on the McpServer with input schema, description, and annotations.
    server.registerTool(
      "code_nav.health",
      {
        description: "Check repo detection and code_nav dependency health.",
        inputSchema: {},
        annotations: { readOnlyHint: true, openWorldHint: false },
      },
      async () => mcpJson(await health()),
    );
  • Imports the health function and the mcpJson helper used by the tool handler.
    import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
    import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
    import { z } from "zod/v4";
    import { mcpJson } from "./core/json.js";
    import { coverage } from "./tools/coverage.js";
    import { exactAuditTool } from "./tools/exact-audit.js";
    import { exactSearch } from "./tools/exact-search.js";
    import { extractContextTool } from "./tools/extract-context.js";
    import { findFile } from "./tools/find-file.js";
    import { health } from "./tools/health.js";
    import { search } from "./tools/search.js";
    import { structuralSearchTool } from "./tools/structural-search.js";
    
    export function createServer(): McpServer {
      const server = new McpServer({
        name: "code_nav",
        version: "0.1.0",
      });
    
      server.registerTool(
        "code_nav.health",
        {
          description: "Check repo detection and code_nav dependency health.",
          inputSchema: {},
          annotations: { readOnlyHint: true, openWorldHint: false },
        },
        async () => mcpJson(await health()),
      );
Behavior4/5

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

Annotations already indicate readOnlyHint=true and openWorldHint=false, so the description adds value by specifying that it checks 'repo detection and code_nav dependency health,' providing context beyond the annotations. There is no contradiction.

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

Conciseness5/5

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

The description is a single, focused sentence with no redundant words. It is front-loaded and efficiently conveys the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no parameters and annotations present, the description is somewhat complete but lacks information about what the output looks like (e.g., status, message). Since there is no output schema, an agent might need more detail to interpret results.

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

Parameters4/5

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

The input schema has no parameters, so per guidelines the baseline is 4. No additional parameter explanation is needed.

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?

The description clearly states the tool's purpose: 'Check repo detection and code_nav dependency health.' It uses a specific verb ('Check') and identifies distinct resources (repo detection, dependency health), which differentiates it from sibling tools focused on searching or extraction.

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

Usage Guidelines3/5

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

The description implies the tool should be used to verify repo detection and dependency health, but it does not explicitly state when to use it versus alternatives like code_nav.search or code_nav.extract_context. No exclusions or prerequisites are mentioned.

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

Install Server

Other Tools

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/ARQAWA/code-nav-mcp'

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