Skip to main content
Glama

Describe Public API Surface

describe_api_surface
Read-onlyIdempotent

List the public API surface of a C# solution or namespace as compact type and member signatures. Use it to review contracts before changes or compare baselines.

Instructions

List the PUBLIC API SURFACE of a solution or namespace - every externally-visible type with its externally-visible members (constructors, properties, fields, events, methods, user-defined operators), each as a compact declaration signature. The "header"/contract view: what a consumer of this assembly can actually reference, WITHOUT the source bodies (like a public-API digest, not a firehose). A type is included when its OWN declared accessibility is externally visible - public or the protected family (reachable by a subclass in another assembly); its members likewise. A property renders only the accessors that are themselves visible (a { get; private set; } shows as { get; }), a const carries its value, an enum is listed as a type (its values are not in the model). includeInternal=true additionally surfaces the internal family. PRODUCTION-FOCUSED: test projects are excluded by default (a shipped API surface is production code) - set includeTests=true to include .Tests/.Spec projects. scope='solution' (default) covers everything; a namespace prefix narrows it, and one that matches no namespace gets a 'note' ahead of typesScanned 0. The type list is capped (the true total travels in the envelope; narrow by namespace or filter to see the rest); members per type are whole. Recall-safe (reads persisted accessibility + signature facts) → works on live AND recalled sessions. Known v1 simplifications: accessibility is the type's OWN declared modifier (effective accessibility through the nesting chain is not computed - a public member of a type nested in an internal type is still listed); a type declared with NO access modifier is stored as private by the analyzer, so a modifier-omitted (compiler-internal) top-level type is not surfaced even with includeInternal. Use it to review a public contract before changing it, or as the baseline for a contract comparison - save_session then compare_with_previous, or diff_public_contract, which is outside the default profile's pool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNo'solution' (default - the whole solution) or a namespace prefix (e.g. 'MyApp.Contracts') to narrow the surface.solution
sessionIdYesThe session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use.
includeTestsNoInclude test projects (default FALSE - a shipped API surface is production code). Set true to include *.Tests/*.Spec projects.
includeInternalNoInclude the internal family (internal / private-protected) types + members too (default FALSE = only the externally-visible public/protected surface).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.46513
    • changedInput schema / properties / sessionId / description
      Previous value: -"The session_id returned by analyze_solution."New value: +"The session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use."
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered; the description adds substantial beyond-schema behavior: how property accessors, consts, and enums render, that the type list is capped with the true total in the envelope, that it works on live AND recalled sessions, and honest "Known v1 simplifications" about accessibility computation and modifier-omitted types.

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

Conciseness3/5

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

The purpose is front-loaded in the first sentence, and most sentences carry load-bearing detail. However, the volume is high for a 4-param read-only tool, with heavy ALL-CAPS emphasis and stacked parentheticals that reduce scannability and add redundancy (accessibility/rendering rules are stated twice).

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?

With no output schema, the description carries the return-shape burden and does so well: it explains declarations are compact signatures, that member lists are whole while types are capped, and that the envelope carries the true total. Combined with the simplification caveats, an agent has everything needed to call and interpret it correctly.

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, but the description adds real semantics the schema lacks: includeInternal surfaces the internal/private-protected family, and a namespace prefix matching no namespace yields a 'note' ahead of typesScanned 0. It reinforces the defaults for scope and includeTests rather than merely restating them.

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?

The first sentence names a specific verb ("List") and resource ("PUBLIC API SURFACE of a solution or namespace") and immediately clarifies scope (externally-visible types with their members). It differentiates itself from siblings by naming compare_with_previous and diff_public_contract, plus the "public-API digest, not a firehose" framing that separates it from a full-documentation tool.

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 explicit use cases ("review a public contract before changing it, or as the baseline for a contract comparison") and names the chaining alternatives (save_session then compare_with_previous, or diff_public_contract, noting the latter is outside the default profile). It does not state an explicit when-not condition beyond the firehose contrast, so it falls just short of a 5.

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