Skip to main content
Glama
pkp124

cmake-build-model

by pkp124

Get target details

get_target
Read-only

Queries the CMake build model to retrieve complete details of one target: artifacts, dependencies, compile flags, defines, includes, sources, and install rules.

Instructions

Full details of one target: artifacts, where it is defined, dependencies, link/archive command fragments, install destinations, and per compile group the language standard, flags, defines and include directories, plus its source files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesTarget name or File API target id.
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.
maxSourcesNoMaximum number of sources to list.
configurationNoBuild configuration (e.g. Debug, Release) for multi-config generators. Defaults to the first one.
includeSourcesNoInclude the list of source files.
includeBacktracesNoInclude CMake backtraces (file:line of the command) for sources, defines, includes, etc.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/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 the useful scope limitation that it returns exactly one target's details, but is silent on behavior driven by the tool's own parameters, e.g. that source listing is capped/paginated or that backtraces are off by default.

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?

A single front-loaded sentence beginning with the resource ('Full details of one target'), followed by a compact enumeration of return fields. No filler, though the enumeration runs long enough that the tail is easy to skim past.

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, the description carries the burden of describing return values and does so concretely (artifacts, definitions, dependencies, link/archive fragments, install destinations, compile-group settings, sources). Combined with 100% parameter coverage, the agent has enough to call it, though the absence of any usage routing leaves a small gap.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents target, buildDir, maxSources, configuration, includeSources and includeBacktraces in detail. The description adds no parameter-level meaning beyond that, so the baseline of 3 applies.

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?

States a specific verb and resource ('Full details of one target') and enumerates the returned content domains (artifacts, dependencies, flags, source files), so the agent knows exactly what class of information this returns. It does not, however, distinguish itself from siblings like get_target_dependencies or get_project_summary, which overlap in surface area.

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

Usage Guidelines2/5

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

The description contains no when-to-use or when-not-to-use guidance and names no alternative. An agent must infer that this is the broad 'single target' call versus list_targets (enumeration) or get_target_dependencies (dependency-only view).

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