Skip to main content
Glama

ad4m_config_check

Verifies that mcp-ad4m is registered in the correct config file to prevent silent connection failures caused by misconfiguration.

Instructions

Check whether mcp-ad4m is registered in the correct config file. Detects the wrong-file misconfiguration that causes silent connection failures.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function for ad4m_config_check. Checks ~/.claude.json for correct ad4m MCP registration, detects wrong-file misconfiguration (settings.json), and returns status/fix command.
    function configCheck(): { status: string; detail: string; fix_command?: string } {
      let claude: ClaudeJson | null = null;
      try { claude = JSON.parse(readFileSync(join(HOME, ".claude.json"), "utf8")); }
      catch { /* missing */ }
    
      if (!claude) {
        return {
          status: "missing",
          detail: "~/.claude.json not found.",
          fix_command: `claude mcp add -e AD4M_GQL_URL=${AD4M_GQL} ad4m -- ${HOME}/bin/mcp-ad4m`,
        };
      }
      if (claude.projects?.[HOME]?.mcpServers?.["ad4m"]) {
        return { status: "ok", detail: "ad4m is registered in the correct project-scoped location." };
      }
      if (claude.mcpServers?.["ad4m"]) {
        return { status: "ok", detail: "ad4m is registered at user scope (top-level)." };
      }
      let inSettingsJson = false;
      try {
        const s = JSON.parse(readFileSync(join(HOME, ".claude", "settings.json"), "utf8"));
        inSettingsJson = !!(s?.mcpServers?.["ad4m"]);
      } catch { /* ignore */ }
      if (inSettingsJson) {
        return {
          status: "wrong_file",
          detail: "ad4m is in ~/.claude/settings.json which Claude Code IGNORES for MCP registration.",
          fix_command: `claude mcp add -e AD4M_GQL_URL=${AD4M_GQL} ad4m -- ${HOME}/bin/mcp-ad4m`,
        };
      }
      return {
        status: "missing",
        detail: "ad4m is not registered anywhere Claude Code can find it.",
        fix_command: `claude mcp add -e AD4M_GQL_URL=${AD4M_GQL} ad4m -- ${HOME}/bin/mcp-ad4m`,
      };
    }
  • src/index.ts:377-381 (registration)
    Tool registration on the MCP server using server.tool() with no input schema and delegating to configCheck() handler.
    server.tool("ad4m_config_check",
      "Check whether mcp-ad4m is registered in the correct config file. Detects the wrong-file misconfiguration that causes silent connection failures.",
      {},
      async () => ok(configCheck())
    );
  • No input parameters (empty object schema) — ad4m_config_check requires no arguments.
    {},
  • Helper function that wraps the result into MCP content format.
    function ok(data: unknown) {
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It reveals the behavior (registration check and misconfiguration detection) but does not specify the return format, output on success/failure, or potential side effects. This is adequate but lacks detail.

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?

A single efficient sentence that conveys the purpose and detection capability with no wasted words. It is front-loaded with the key action.

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?

The description covers the purpose and use case but lacks information about the tool's return value or output format. Since there is no output schema, the agent is left guessing what the result looks like, which is a notable gap.

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 tool has no parameters, and schema coverage is 100%. The description does not need to add parameter information. Baseline for zero parameters is 4.

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 verb 'Check' and the resource 'mcp-ad4m registration in config file', and specifies detection of a specific misconfiguration. It is distinct from sibling tools like ad4m_agent_status or ad4m_optimize.

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

Usage Guidelines4/5

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

The description implies the tool is used when silent connection failures due to wrong-file misconfiguration are suspected. It provides clear context but does not explicitly state when not to use it or list alternatives among siblings.

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/thefranceway/mcp-ad4m'

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