Skip to main content
Glama

List Code Insights

list_insights
Read-onlyIdempotent

Lists code-quality, async, and design-smell insights for an analyzed C# solution or session, with triage-filtered findings and optional file-scoped results.

Instructions

List code-quality / async / design-smell insights for a session (long methods, fat interfaces, unused types, missing async suffixes, many-parameter methods, ...). Runs against the live analyzed solution; each insight is aggregated per producer, with the count of its detail lines ('detailsCount', all of them; get_insight lists the first 20). dbPath picks the QualityProfile (producer thresholds + toggles); its parameter gives the fallback. Honors the session's active test-detection profile (resolved by analyze_solution(dbPath)) for the production-focused producers. An explicit analyze_solution(layerProfile) drives the layer-violation insight and wins over the DB-configured profile. THIS ANSWER IS TRIAGE-FILTERED, on BOTH triage axes: findings the solution marked intentional (a suppression - in the DB or in the git-tracked .aicb.json sidecar) AND findings a user dismissed as seen (in the solution record, NOT in the sidecar) are removed, and an insight whose findings are all gone does not appear at all. Every insight that lost lines carries 'suppressed' with the count of what BOTH axes removed together (absent = nothing filtered), so a shrinking number is never mistaken for a codebase that improved - but do not read that count as a sidecar entry count, because some of it is dismissal. Note 'title' is producer text computed BEFORE filtering, so on a partially filtered insight it still names the pre-filter total - 'detailsCount' + 'suppressed' are the real split. 'sharedTriageKeys' {keys, lines}: lines sharing a type and member name, which one suppression or dismissal silences together (overloads, same-named types, several kinds on one member). 'remediationCostMinutes' is a coarse order-of-magnitude estimate from fixed per-finding rules, not measured effort. Pass files - say the files a change touches - for the findings about the types they declare, with their detail lines.

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": "list_insights"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesNoOptional C# files, each absolute or relative to the solution folder: the answer keeps the findings about the types these files declare and becomes an object {files, notInSolution, insights}. 'files' are the ones the solution holds, solution-relative; 'notInSolution' the ones it does not (a deleted or non-C# file, a typo), as given. Each insight carries its in-scope 'details' with 'detailLocators' (up to 20, then a '(... and N more)' line), and 'detailsCount' counts the in-scope lines; 'title', 'remediationCostMinutes' and 'suppressed' stay the whole-solution numbers, and so is 'sharedTriageKeys' (a key silences its lines in every file). A line matches by its locator's simple type name, so a same-named type elsewhere matches too, except on a member line whose member only that other type, or another file's fragment of a partial type, declares; a line about a file of top-level statements matches by that file; any other line with no type locator is left out, while an insight about the solution as a whole (no lines, no type locator) stays, with detailsCount 0. Omitted or empty: the solution-wide array above.
dbPathNoOptional path to an AIContextBuilder SQLite DB. When set, producer thresholds + toggles come from that DB's active QualityProfile AND the configured default layer profile (DefaultLayerProfileName / per-solution) drives the layer-violation analysis (an explicit analyze_solution(layerProfile) wins). Omitted, the QualityProfile falls back to the server's default config DB (the GUI's, if resolved), else the default profile, and the layer profile to the config DB the session was analysed against - the one its renders read.
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.46521
    • changedInput schema / properties / files / description
      Previous value: -"Optional C# files, each absolute or relative to the solution folder: the answer keeps the findings about the types these files declare and becomes an object {files, notInSolution, insights}. 'files' are the ones the solution holds, solution-relative; 'notInSolution' the ones it does not (a deleted or non-C# file, a typo), as given. Each insight carries its in-scope 'details' with 'detailLocators' (up to 20, then a '(... and N more)' line), and 'detailsCount' counts the in-scope lines; 'title', 'remediationCostMinutes' and 'suppressed' stay the whole-solution numbers. A line matches by its locator's simple type name, so a same-named type elsewhere matches too, except on a member line whose member only that other type declares; a line about a file of top-level statements matches by that file; any other line with no type locator is left out, while an insight about the solution as a whole (no lines, no type locator) stays, with detailsCount 0. Omitted or empty: the solution-wide array above."New value: +"Optional C# files, each absolute or relative to the solution folder: the answer keeps the findings about the types these files declare and becomes an object {files, notInSolution, insights}. 'files' are the ones the solution holds, solution-relative; 'notInSolution' the ones it does not (a deleted or non-C# file, a typo), as given. Each insight carries its in-scope 'details' with 'detailLocators' (up to 20, then a '(... and N more)' line), and 'detailsCount' counts the in-scope lines; 'title', 'remediationCostMinutes' and 'suppressed' stay the whole-solution numbers, and so is 'sharedTriageKeys' (a key silences its lines in every file). A line matches by its locator's simple type name, so a same-named type elsewhere matches too, except on a member line whose member only that other type, or another file's fragment of a partial type, declares; a line about a file of top-level statements matches by that file; any other line with no type locator is left out, while an insight about the solution as a whole (no lines, no type locator) stays, with detailsCount 0. Omitted or empty: the solution-wide array above."
  2. Changed1 schema field changedv0.5.46519
    • changedInput schema / properties / files / description
      Previous value: -"Optional C# files, each absolute or relative to the solution folder: the answer keeps the findings about the types these files declare and becomes an object {files, notInSolution, insights}. 'files' are the ones the solution holds, solution-relative; 'notInSolution' the ones it does not (a deleted or non-C# file, a typo), as given. Each insight carries its in-scope 'details' with 'detailLocators' (up to 20, then a '(... and N more)' line), and 'detailsCount' counts the in-scope lines; 'title', 'remediationCostMinutes' and 'suppressed' stay the whole-solution numbers. A line matches by its locator's simple type name, so a same-named type elsewhere matches too; a line about a file of top-level statements matches by that file; any other line with no type locator is left out, while an insight about the solution as a whole (no lines, no type locator) stays, with detailsCount 0. Omitted or empty: the solution-wide array above."New value: +"Optional C# files, each absolute or relative to the solution folder: the answer keeps the findings about the types these files declare and becomes an object {files, notInSolution, insights}. 'files' are the ones the solution holds, solution-relative; 'notInSolution' the ones it does not (a deleted or non-C# file, a typo), as given. Each insight carries its in-scope 'details' with 'detailLocators' (up to 20, then a '(... and N more)' line), and 'detailsCount' counts the in-scope lines; 'title', 'remediationCostMinutes' and 'suppressed' stay the whole-solution numbers. A line matches by its locator's simple type name, so a same-named type elsewhere matches too, except on a member line whose member only that other type declares; a line about a file of top-level statements matches by that file; any other line with no type locator is left out, while an insight about the solution as a whole (no lines, no type locator) stays, with detailsCount 0. Omitted or empty: the solution-wide array above."
  3. Changed1 schema field changedv0.5.46517
    • changedInput schema / properties / files / description
      Previous value: -"Optional C# files, each absolute or relative to the solution folder: the answer keeps the findings about the types these files declare and becomes an object {files, notInSolution, insights}. 'files' are the ones the solution holds, solution-relative; 'notInSolution' the ones it does not (a deleted or non-C# file, a typo), as given. Each insight carries its in-scope 'details' with 'detailLocators' (up to 20, then a '(... and N more)' line), and 'detailsCount' counts the in-scope lines; 'title', 'remediationCostMinutes' and 'suppressed' stay the whole-solution numbers. A line matches by its locator's simple type name, so a same-named type elsewhere matches too; a line with no type locator is left out, while an insight about the solution as a whole (no lines, no type locator) stays, with detailsCount 0. Omitted or empty: the solution-wide array above."New value: +"Optional C# files, each absolute or relative to the solution folder: the answer keeps the findings about the types these files declare and becomes an object {files, notInSolution, insights}. 'files' are the ones the solution holds, solution-relative; 'notInSolution' the ones it does not (a deleted or non-C# file, a typo), as given. Each insight carries its in-scope 'details' with 'detailLocators' (up to 20, then a '(... and N more)' line), and 'detailsCount' counts the in-scope lines; 'title', 'remediationCostMinutes' and 'suppressed' stay the whole-solution numbers. A line matches by its locator's simple type name, so a same-named type elsewhere matches too; a line about a file of top-level statements matches by that file; any other line with no type locator is left out, while an insight about the solution as a whole (no lines, no type locator) stays, with detailsCount 0. Omitted or empty: the solution-wide array above."
  4. Changed1 schema field changedv0.5.46516
    • addedInput schema / properties / files
      Added value: +{
      +  "default": null,
      +  "description": "Optional C# files, each absolute or relative to the solution folder: the answer keeps the findings about the types these files declare and becomes an object {files, notInSolution, insights}. 'files' are the ones the solution holds, solution-relative; 'notInSolution' the ones it does not (a deleted or non-C# file, a typo), as given. Each insight carries its in-scope 'details' with 'detailLocators' (up to 20, then a '(... and N more)' line), and 'detailsCount' counts the in-scope lines; 'title', 'remediationCostMinutes' and 'suppressed' stay the whole-solution numbers. A line matches by its locator's simple type name, so a same-named type elsewhere matches too; a line with no type locator is left out, while an insight about the solution as a whole (no lines, no type locator) stays, with detailsCount 0. Omitted or empty: the solution-wide array above.",
      +  "items": {
      +    "type": [
      +      "string",
      +      "null"
      +    ]
      +  },
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
  5. Changed1 schema field changedv0.5.46514
    • changedInput schema / properties / dbPath / description
      Previous value: -"Optional path to an AIContextBuilder SQLite DB. When set, producer thresholds + toggles come from that DB's active QualityProfile AND the configured default layer profile (DefaultLayerProfileName / per-solution) drives the layer-violation analysis (an explicit analyze_solution(layerProfile) wins); omit to fall back to the server's default config DB (the GUI's, if resolved), else the default profile + the explicit session layer profile."New value: +"Optional path to an AIContextBuilder SQLite DB. When set, producer thresholds + toggles come from that DB's active QualityProfile AND the configured default layer profile (DefaultLayerProfileName / per-solution) drives the layer-violation analysis (an explicit analyze_solution(layerProfile) wins). Omitted, the QualityProfile falls back to the server's default config DB (the GUI's, if resolved), else the default profile, and the layer profile to the config DB the session was analysed against - the one its renders read."
  6. 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."
  7. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Nothing here contradicts the annotations (readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=false), and the description adds behavior annotations cannot express: results are triage-filtered on two axes (solution-marked suppressions in the DB or the git-tracked .aicb.json sidecar, plus user dismissals in the solution record but not the sidecar), and an insight whose findings are all filtered disappears entirely. It further discloses that 'suppressed' merges both axes, that 'title' is pre-filter producer text while detailsCount + suppressed are the real split, that remediationCostMinutes is a coarse fixed-rule estimate rather than measured effort, and that the tool runs against the live analyzed solution. These are exactly the caveats an agent needs to avoid misreporting a shrinking number as codebase improvement.

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, but the body is a dense run-on of parentheticals, ALL-CAPS emphasis, and nested clauses that makes it harder to scan than it needs to be. The information is nearly all load-bearing, yet it could be restructured into short labeled points rather than one long paragraph with asides.

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?

There is no output schema, and the description compensates by documenting the returned fields and their relationships: per-producer aggregation, detailsCount versus the 20-line truncation in get_insight, the optional 'suppressed' field, sharedTriageKeys {keys, lines} as the unit a single suppression silences, and the changed {files, notInSolution, insights} shape when 'files' is passed. For a three-parameter read tool with strong annotations, nothing an agent needs to call or interpret it correctly appears to be missing.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, yet the description still adds meaning: sessionId also accepts an absolute .sln/.slnx/.slnf path analyzed on first use, and dbPath's fallback chain is spelled out (DB's active QualityProfile, otherwise the server's default config DB, otherwise the default profile; layer profile falls back to the config DB the session was analyzed against). For 'files' it contributes matching semantics beyond the schema - matching by simple type name, same-named types matching across files, member-line and partial-type exceptions, top-level-statement files, and which fields (title, remediationCostMinutes, suppressed, sharedTriageKeys) remain whole-solution numbers.

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 opening sentence names a specific verb plus a concrete resource ('List code-quality / async / design-smell insights for a session') and parenthetically enumerates the producer families (long methods, fat interfaces, unused types, missing async suffixes, many-parameter methods) so an agent knows exactly what kind of findings come back. It also distinguishes itself from get_insight by explaining that get_insight lists only the first 20 detail lines while this tool aggregates per producer with a full detailsCount.

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?

The description gives clear routing context: it names get_insight as the drill-down alternative, states that dbPath selects the QualityProfile, and explains that an explicit analyze_solution(layerProfile) overrides the DB-configured layer profile. It also explains the 'files' mode ('Pass files - say the files a change touches - for the findings about the types they declare'), which tells the agent when to use that parameter rather than calling solution-wide. It stops short of stating hard exclusions (e.g., when to prefer find_dead_code or architecture_overview), so it is clear context rather than a full when/when-not map.

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