Skip to main content
Glama

gen_api_stub

Generate a .spec and stub .c file for one DLL from an API-surface dump; stubs return E_NOTIMPL, ready for implementation from behavioral specs.

Instructions

Generate .spec + stub .c for one DLL straight from an API-surface dump (stubs return E_NOTIMPL; implement from behavioral specs, highest-import first).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
moduleYes
max_stubsNo
workspaceYes
surface_jsonYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries full burden but does disclose a key behavioral trait: stubs return E_NOTIMPL, i.e. they are non-functional placeholders. It omits file-writing side effects, whether existing files are overwritten, and any workspace requirements.

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 dense sentence with the core action and output artifacts front-loaded; the parenthetical adds sequencing context efficiently without padding.

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

Completeness3/5

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

An output schema exists so return values needn't be explained, and the core generate-from-dump behavior is covered. But for a file-writing tool with no annotations and 0% parameter documentation, the gaps around workspace and max_stubs leave the agent under-informed.

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

Parameters2/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 all four parameters. It only loosely maps to two of them ('one DLL' ~ module, 'API-surface dump' ~ surface_json) and says nothing about workspace or max_stubs, leaving half the surface undocumented.

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 (Generate) and concrete resources (.spec + stub .c) scoped to 'one DLL' and sourced from 'an API-surface dump'. It clearly differs from dump_api_surface (which produces the dump) and gen_compat_layer, though it doesn't name those siblings explicitly.

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?

The parenthetical implies sequencing ('implement from behavioral specs, highest-import first') and hints this comes after a surface dump, but it never states when to choose this tool over scaffold_component or gen_compat_layer, nor any prerequisites like workspace setup.

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