Skip to main content
Glama

Describe Public API Surface

describe_api_surface
Read-onlyIdempotent

Lists the externally visible public API surface of a .NET solution or namespace as compact signatures, excluding test projects by default, to review or compare contracts.

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 (includeTests=true includes them). 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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sessionId": "<sessionId>"
    },
    "name": "describe_api_surface"
  }
}

Input 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.3/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, yet the description adds substantive behavior: the type list is capped while the true total travels in the envelope, members per type are whole, results work on live and recalled sessions, and unspecified namespaces return a 'note' ahead of typesScanned 0. It also discloses v1 limitations (own-declared accessibility only, effective nesting-chain accessibility not computed, modifier-omitted types stored as private and therefore hidden even with includeInternal), which is exactly the kind of caveat structured fields cannot convey.

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?

Front-loaded with the core definition and scoped tightly to what an agent needs, and nearly every clause carries information (exclusions, caps, edge cases). It is still a single dense paragraph with heavy parentheticals and all-caps emphasis, which slows scanning, but the length is largely justified by the tool's complexity.

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 compensates by describing the envelope (true total, typesScanned, note) and the truncation contract. The remaining gap is that specific envelope field names are not enumerated, so an agent knows truncation exists but not the full return shape.

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; the description earns a notch above by adding consequences the schema lacks (includeInternal additionally surfaces the internal family, includeTests pulls in *.Tests/*.Spec projects, a namespace prefix that matches nothing yields a note) and by restating the 'solution' default semantics with an example prefix.

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 specific verb and resource ('List the PUBLIC API SURFACE of a solution or namespace') and pins down the exact unit returned: every externally-visible type with its externally-visible members, rendered as compact declaration signatures without source bodies. The 'header/contract view' framing and contrast with a 'firehose' make it clearly distinct from siblings like architecture_overview or docs.

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?

Gives concrete scenarios ('review a public contract before changing it, or as the baseline for a contract comparison') and names follow-on tools (save_session then compare_with_previous, or diff_public_contract). It does not explicitly say when to prefer sibling tools like architecture_overview or find_usages instead, so a 5 is not warranted.

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