Skip to main content
Glama

cpp_set_codebase_path

Point the C++ analysis bridge at a source directory to index .h/.cpp files. Auto-resolves to the project's Source/ folder from a .uproject file, with path validation against traversal attacks.

Instructions

Point the C++ analysis bridge at a source directory.

If path is None (default), auto-resolves to the project's Source/ directory by scanning upward for a .uproject file, then falls back to UNREAL_PROJECT_SOURCE_PATH env var.

The path is validated to prevent directory traversal attacks. Only paths under the project root or an explicit allowed prefix are accepted.

Args: path: Absolute path to source directory. None = auto-resolve.

Returns: JSON StructuredResult with outputs: path — resolved absolute path files_indexed — number of .h/.cpp files found parser — 'tree-sitter-cpp' or 'regex-fallback'

KB: see knowledge_base/12_MCP_TOOL_USAGE_GUIDE.md#overview Example: cpp_set_codebase_path()

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the disclosure burden. It discloses default resolution order, directory traversal protection, the allowed-path restriction, and the structured return fields. It stops short of describing failure behavior or persistent side effects on the bridge, but no annotation contradiction exists and most behavioral expectations are covered.

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?

Front-loaded purpose sentence, then compact labeled sections for arguments, returns, KB reference, and example. Every section adds distinct value without filler or redundant restatement of the tool name.

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

Completeness5/5

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

For a tool with one optional parameter and no annotations, the description covers purpose, resolution rules, security validation, output fields, and a call example. The output schema handles return structure, and the KB reference provides deeper guidance, so nothing essential is missing.

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?

Schema description coverage is 0%, so the description must compensate for the path parameter. It explains that path is an absolute directory, that None auto-resolves, and how the fallback works. The only vagueness is 'explicit allowed prefix', but the parameter is otherwise well explained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with 'Point the C++ analysis bridge at a source directory', which names a concrete action and resource, and the rest clarifies it is about configuring where C++ analysis looks for code. It does not explicitly differentiate from sibling tools like cpp_analyze_class or cpp_find_references, but the setup role is clear enough that confusion is unlikely.

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?

Gives clear usage context: no path means auto-resolution to the project's Source directory, with a documented fallback to UNREAL_PROJECT_SOURCE_PATH. It does not explicitly say 'use before cpp_analyze_class' or list when-not alternatives, but the description makes the intended call sequence reasonably obvious.

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

Deploy Server

Other Tools