{"record":{"id":"fabba4613ffa52ec","repo":"rohitg00/agentmemory","slug":"unknown-tools-value-toolsmode-valid-all","errorCode":null,"errorMessage":"Unknown --tools value \"${toolsMode}\" (valid: all, core); falling back to all.","messagePattern":"Unknown --tools value \"(.+?)\" \\(valid: all, core\\); falling back to all\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/cli.ts","lineNumber":252,"sourceCode":"                               (default 30). Long values overcount, short values undercount.\n\nQuick start:\n  npx @agentmemory/agentmemory          # start with local iii-engine or Docker\n  npx @agentmemory/agentmemory demo     # see semantic recall in 30 seconds\n  npx @agentmemory/agentmemory doctor   # diagnose config + feature flags\n  npx @agentmemory/agentmemory status   # health + memory count + flags\n  npx @agentmemory/agentmemory upgrade  # upgrade agentmemory + iii runtime\n  npx @agentmemory/agentmemory mcp      # standalone MCP server (no engine)\n  npx @agentmemory/mcp                  # same as above (shim package)\n`);\n  process.exit(0);\n}\n\nconst toolsIdx = args.indexOf(\"--tools\");\nif (toolsIdx !== -1 && args[toolsIdx + 1]) {\n  const toolsMode = args[toolsIdx + 1]!;\n  if (toolsMode !== \"all\" && toolsMode !== \"core\") {\n    p.log.warn(\n      `Unknown --tools value \"${toolsMode}\" (valid: all, core); falling back to all.`,\n    );\n  }\n  process.env[\"AGENTMEMORY_TOOLS\"] = toolsMode;\n}\n\nconst URL_CLIENT_COMMANDS = new Set([\"status\", \"doctor\", \"mcp\"]);\nlet hasExplicitLocalPortOverride = false;\nlet selectedInstance = 0;\n\nfunction cliArgValue(name: string): string | undefined {\n  const inline = args.find((arg) => arg.startsWith(`${name}=`));\n  if (inline) return inline.slice(name.length + 1);\n  const index = args.indexOf(name);\n  return index === -1 ? undefined : args[index + 1];\n}\n\nconst portValue = cliArgValue(\"--port\");","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/rohitg00/agentmemory/blob/e04ba88819c365c9acf9d6661ea802143e728bd6/src/cli.ts#L234-L270","documentation":"The CLI parses --tools <mode> at startup (src/cli.ts:252) and only accepts 'all' or 'core'. Any other value logs 'Unknown --tools value \"<v>\" (valid: all, core); falling back to all.' as a warning, then still assigns the value to AGENTMEMORY_TOOLS (which the tool registry treats as the 'all' default). Non-fatal; the process continues.","triggerScenarios":"Running the CLI or a generated config with --tools minimal / default / visible / a typo like 'cores' or 'AL ', or a stale config from an older version that accepted different mode names.","commonSituations":"Users guessing mode names after reading about AGENTMEMORY_TOOLS=all; copy-pasted configs from other tools that use 'core'/'extended' vocabularies; outdated documentation or hook scripts embedding an old value.","solutions":["Use --tools all or --tools core (exact lowercase spelling).","Fix the value in whatever passes it: the MCP registration config, hook script, or shell alias.","Remove the --tools flag entirely to use the default.","Verify the current valid set in the CLI help (agentmemory --help) if upgrading from an older version."],"exampleFix":"// before\nagentmemory serve --tools minimal\n// after\nagentmemory serve --tools core","handlingStrategy":"validation","validationCode":"const TOOLS_MODES = [\"all\", \"core\"] as const;\nconst mode = process.argv.find(v => TOOLS_MODES.includes(v as any));\nif (!mode) console.warn(\"--tools must be 'all' or 'core'\");","typeGuard":"const isToolsMode = (v: unknown): v is \"all\" | \"core\" =>\n  v === \"all\" || v === \"core\";","tryCatchPattern":null,"preventionTips":["Only pass --tools all or --tools core; omit the flag for the default.","Grep generated hook/MCP configs for --tools when upgrading.","Check agentmemory --help for currently valid values after version changes.","Avoid free-form env values in AGENTMEMORY_TOOLS from untrusted config sources."],"tags":["cli","argument-parsing","config","fallback","warning"],"backgroundTag":"invalid-flag-value","analyzedSha":"e04ba88819c365c9acf9d6661ea802143e728bd6","analyzedAt":"2026-08-30T01:07:40.754Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}