Skip to main content
Glama
pkp124

cmake-build-model

by pkp124

Get compile commands

get_compile_commands
Read-only

Read exact compiler invocations from compile_commands.json, filtered by file, target, path pattern, or configuration to inspect build commands.

Instructions

Reads the exact compiler invocations from compile_commands.json in a build directory, filtered by file, path pattern, target and/or configuration. When file is given without buildDir, every build directory of the workspace that compiles the file is searched. Each entry has the working directory, the argument list, the original command string (when the database uses command) and the output file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoExact source file path (absolute or relative to a workspace root).
limitNoMaximum number of entries per build directory.
filterNoSource path filter: substring, glob or /regex/.
targetNoOnly commands compiling objects of this target.
buildDirNoBuild directory (absolute, or relative to a workspace root). A source directory with a single build directory is also accepted. May be omitted when the workspace has exactly one build directory.
configurationNoOnly commands of this configuration (multi-config generators; ignored otherwise).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds real behavioral context beyond that: the workspace-wide fallback search when buildDir is omitted, and the shape of each returned entry (working directory, argument list, original command string, output file). It does not mention limits or pagination semantics beyond the default, but the added disclosure is substantive.

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

Conciseness4/5

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

Three sentences, front-loaded with the core action and filtering axes, with no filler. The return-shape sentence is slightly dense but earns its place given there is no output schema. Minor tweak would be to break the last, list-heavy sentence.

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

Completeness4/5

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

With no output schema and six optional parameters, the description compensates by describing the returned entries and the fallback search behavior. The one lingering gap is pagination/ordering semantics around `limit` (capped at 50 by default), which is only implied by the schema.

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 coverage is 100%, so the baseline is 3 and the schema already documents all six parameters. The description still adds value by clarifying cross-parameter behavior – that omitting buildDir while supplying file widens the search to all workspace build directories – which is not stated in the schema.

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?

Names a specific verb and resource ('Reads the exact compiler invocations from compile_commands.json') and states the filtering axes, which cleanly separates it from siblings like get_cache_variables, list_targets, and get_target. An agent can identify the tool's job without opening the schema.

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?

It gives a clear usage condition – when you need exact compiler invocations – and explains the important cross-parameter case (file given without buildDir searches every build directory of the workspace). It does not name explicit alternatives or when-not-to-use this tool, so it stops short of full routing guidance.

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