Skip to main content
Glama

Find Symbols by Attribute

find_by_attribute
Read-onlyIdempotent

Locate C# symbols—types, methods, properties, or fields—that carry a specified attribute, including member-level ones missed by name-only searches.

Instructions

Find symbols (types, methods, properties or fields) that carry a given ATTRIBUTE - a cross-cutting query that find_symbol (name-only) cannot do. The attribute name is matched format-independently: the last name segment, with an optional 'Attribute' suffix stripped, case-insensitive. So 'Obsolete', 'ObsoleteAttribute' and 'System.ObsoleteAttribute' all match the same symbols (types store the fully-qualified attribute class, methods/properties/fields store the source-syntax name - this reconciles both). The raw stored attribute list travels with each hit so you see the ground truth. kinds = 'all' (default - types + methods + properties + fields) / 'type' / 'method' / 'property' / 'field'. Member scanning surfaces a member-level attribute like a CommunityToolkit '[ObservableProperty]' (on a backing field or a modern partial property) or a '[JsonProperty]' that a type/method-only scan misses. Use it for '[Obsolete]', '[ApiController]', '[Authorize]', test attributes, etc. The 'method' axis includes constructors and accessors with a body (named .ctor / get_X / set_X), so a [JsonConstructor] or an [Obsolete] setter is found. Deterministic from Roslyn - works on recalled sessions. Capped at 200.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindsNoWhich symbol kinds to search: 'all' (default - types + methods + properties + fields), 'type', 'method', 'property', or 'field'.all
scopeNo'solution' (default) or a namespace prefix (e.g. 'MyApp.Api') to narrow scope.solution
attributeYesThe attribute to find (e.g. 'Obsolete', 'ApiController', 'Fact'). Suffix/namespace are normalized away - required.
sessionIdYesThe session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use.

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.8/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, non-open-world), yet the description adds substantial behavior beyond that: deterministic Roslyn evaluation, validity on recalled sessions, the 200-result cap, and the fact that the raw stored attribute list is returned with each hit.

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 purpose then matching semantics, with zero filler sentences. It is dense and slightly long, but nearly every clause carries actionable detail, so it stays close to the top of the range.

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?

No output schema exists, yet the description explains that the raw stored attribute list travels with each hit, and it covers matching, kinds, member scanning, the method-axis nuance, determinism, and the result cap. Nothing needed to invoke it correctly is missing.

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 meaning: the attribute param's format-independent normalization (last segment, optional 'Attribute' suffix, case-insensitive, fully-qualified vs source-syntax storage) and the nuanced 'method' axis including .ctor/get_X/set_X. It leaves 'scope' semantics entirely to the schema.

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+resource ('Find symbols ... that carry a given ATTRIBUTE') and immediately differentiates from the sibling find_symbol by noting it is a 'cross-cutting query that find_symbol (name-only) cannot do'. An agent can route between the two without opening either schema.

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?

Explicitly names the alternative (find_symbol) and the condition selecting this tool, plus concrete use cases ('[Obsolete]', '[ApiController]', '[Authorize]', test attributes). It also flags the value-add case where member scanning surfaces attributes a type/method-only scan misses.

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