Skip to main content
Glama
parsiya

Trailmark MCP Server

by parsiya

complexity_hotspots

Retrieve code nodes with cyclomatic complexity above a given threshold to identify high-risk areas in your codebase.

Instructions

Return nodes whose cyclomatic complexity meets the threshold.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thresholdNo
session_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler for complexity_hotspots — delegates to engine.complexity_hotspots(threshold) on the QueryEngine instance stored in the current session handle.
    def complexity_hotspots(
        self,
        threshold: int = 10,
        session_id: str | None = None,
    ) -> list[dict[str, Any]]:
        return self._require_scanned_handle(session_id).engine.complexity_hotspots(threshold)
  • ToolSpec schema defining the tool name, category (navigation), description, and parameters (threshold: integer with default 10, session_id: string|null).
        name="complexity_hotspots",
        category="navigation",
        description="Return nodes whose cyclomatic complexity meets the threshold.",
        parameters={"threshold": _param("integer", default=10), "session_id": SESSION_ID_PARAM},
    ),
  • MCP tool registration via @mcp.tool() decorator — wraps the runtime method with FastMCP, exposing the tool to the MCP server.
    @mcp.tool()
    def complexity_hotspots(threshold: int = 10, session_id: str | None = None) -> list[dict[str, Any]]:
        """Return nodes whose cyclomatic complexity meets the threshold."""
        return app_runtime.complexity_hotspots(threshold=threshold, session_id=session_id)
  • Helper usage during save_snapshot: writes engine.complexity_hotspots(10) to a 'hotspots.json' snapshot file.
    self._write_json(snapshot_dir / "hotspots.json", engine.complexity_hotspots(10))
Behavior2/5

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

No annotations are present, and the description does not disclose behavioral traits such as what types of nodes are considered, how the threshold is applied, or any side effects. The tool appears to be read-only but this is not confirmed.

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 description is a single sentence with no fluff, which is concise, but it lacks necessary details. It is appropriately front-loaded but under-specified.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has two parameters and no schema descriptions, the description is insufficient. It does not explain what nodes are returned, how threshold works, or the role of session_id. An output schema exists but the description adds no context about return values.

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

Parameters2/5

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

The description only mentions the threshold parameter but does not explain its semantics beyond the name. The session_id parameter is completely undocumented. With 0% schema coverage, the description should compensate but fails to do so.

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 clearly states the action ('Return'), the resource ('nodes'), and the specific condition ('cyclomatic complexity meets the threshold'). This distinguishes it from sibling tools that deal with nodes but not complexity thresholds.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. There are no exclusions, context for selection, or examples of appropriate use cases.

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/parsiya/trailmark-mcp-server'

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