Skip to main content
Glama

get_instantiation_options

Retrieve constructors, static factory methods, and DI registrations for a .NET type to determine instantiation options, including accessibility and required members.

Instructions

Answer 'how do I construct this type?' in one call — accessible constructors, static factory methods declared anywhere in the solution, and DI registrations. Constructors report every parameter's type and name, declared accessibility, whether the constructor is compiler-supplied (isImplicit — a struct or a class with no declared constructor still has a usable parameterless one), and whether it is obsolete. Factories are static members returning the type, including ones declared on a DIFFERENT type such as WidgetFactory.Create(), with Task<T>/ValueTask<T> unwrapped and flagged isAsync. Instance builder methods are excluded because the builder itself would need constructing. Pass fromProject to get accessible computed for that project, which honours InternalsVisibleTo — this is how you find out whether your test project can reach an internal constructor. Without it, accessible is null, meaning NOT COMPUTED — which is not the same as false, so do not read a null as 'you cannot call this'. requiredMembers lists members that must be set in an object initializer. diRegistrations shows where the type is registered in a container — a registered type is usually meant to be resolved rather than constructed by hand. For interfaces, abstract classes and static classes, instantiable is false and note explains why; use find_implementations to find concrete types.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesType to construct — simple (`Widget`) or fully qualified (`MyApp.Widget`).
fromProjectNoOptional project name whose viewpoint decides `accessible` (e.g. `MyApp.Tests`).
Behavior5/5

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

With no annotations, the description fully discloses behavior: it explains the returned fields (constructors, factories, diRegistrations, instantiable, note, requiredMembers, accessible) and special semantics like null accessible meaning not computed, instance builder exclusion, async factory unwrapping, and isImplicit. No annotation contradiction.

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?

The description is well-organized: first sentence states core purpose, then enumerates content, then details on accessibility, DI, and non-instantiable types. Every sentence adds value. No redundancy or filler.

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?

Without an output schema, the description must explain what the tool returns, and it does so in detail: constructors (with accessibility, isImplicit, obsolete), factories (including cross-type, async), diRegistrations, requiredMembers, instantiable flag with note, and accessible semantics. It covers all key aspects.

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% (both parameters documented). The description adds meaningful context for fromProject (computes accessible with InternalsVisibleTo). For symbol, it adds 'simple or fully qualified', which is minor but helpful. Exceeds the baseline of 3.

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 description starts with a clear verb-resource pair: 'Answer how do I construct this type?' and lists the covered items (constructors, static factories, DI registrations). It distinguishes itself from siblings like find_implementations and get_type_overview.

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

Usage Guidelines5/5

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

The description explicitly says when to use (to find how to construct a type) and when not: for interfaces/abstract/static classes it says to use find_implementations instead. It also explains that DI registrations indicate the type should be resolved rather than constructed. Alternative tools are named.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MarcelRoozekrans/roslyn-codelens-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server