Skip to main content
Glama
pkp124

cmake-build-model

by pkp124

Get target dependency graph

get_target_dependencies
Read-only

Retrieves the CMake targets a specified target depends on or those that depend on it, returning direct connections and complete transitive chains.

Instructions

Returns the targets a target depends on (dependencies) or the targets depending on it (dependents), directly or transitively, including an adjacency list for the transitive graph.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesTarget name or 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.
directionNodependencies
transitiveNo
configurationNoBuild configuration (e.g. Debug, Release) for multi-config generators. Defaults to the first one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations cover safety (readOnlyHint=true, openWorldHint=false), so the bar is lower, and the description adds real behavioral context: the result includes an adjacency list representing the transitive graph, not just a flat list. It doesn't discuss pagination or size limits, which keeps it from a 5.

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?

One dense sentence with zero filler, front-loading the return content and clarifying the two directions in parenthetical examples.

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?

No output schema exists, and the description usefully sketches the returned shape (adjacency list). Remaining gaps around configuration selection and build-dir resolution are already documented in schema field descriptions, so the definition is largely complete.

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 60% and the bare enum for direction has no schema description; the description supplies the meaning of both values (dependencies vs dependents) and clarifies the transitive-graph output. It adds meaning beyond the schema, though it doesn't touch buildDir/configuration.

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?

States a precise verb and resource (returns targets a target depends on / depending on it) and names the two modes, which distinguishes it from siblings like get_target and list_targets. The graph-traversal framing makes it unmistakable.

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

Usage Guidelines3/5

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

Usage is implied by the direction parameter but the description never states when to choose this tool over get_target or list_targets, nor any prerequisite such as needing a resolved build directory. Adequate but leaves routing to inference.

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