Skip to main content
Glama
Flux-Frontiers

SwiftKG MCP Server

explain_rank

Break down a node's CodeRank score by showing its callers, importers, and inheritors, plus semantic relevance to a query when provided.

Instructions

Explain the CodeRank score components for a specific node.

Returns a Markdown report showing the node's structural position in the graph: how many nodes call it, import it, or inherit from / implement / extend it; its global CodeRank score; and, when a query is provided, its semantic relevance and proximity to the query seed set.

:param node_id: Stable node identifier, e.g. meth:Sources/Networking/Client.swift:HTTPClient.send. :param q: Optional query string. When provided, semantic score and proximity to the query seed set are included in the report. :return: Markdown-formatted explanation of the node's rank components.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNo
node_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description must carry the burden of behavioral disclosure. It states that it 'returns a Markdown report' and describes the conditions under which semantic information is included, which implies a read-only query. However, it does not explicitly state that the tool has no side effects, nor does it mention error handling, prerequisites, or limitations. It is transparent enough for a non-mutating tool, but could be more explicit.

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 concise and well-structured. It opens with the primary purpose, then details the report contents, and finally explains parameters and return format. Every sentence contributes value, and the layout is front-loaded with the most important information.

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?

Despite having an output schema (not shown), the description enumerates the report's components in detail: structural position, call counts, importers, inheritance, global score, and optional semantic relevance and proximity. Combined with thorough parameter explanations, an agent has everything needed to invoke the tool correctly and understand its output. The description is complete for this tool's complexity.

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 description coverage is 0%, so the description must explain parameters fully. It does: node_id is described with a concrete example of a stable node identifier, and q is explained as an optional query that controls whether semantic score and proximity are included. This adds significant meaning beyond the bare schema and fully compensates for the lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool explains CodeRank score components for a specific node, and lists the specific content of the report (callers, importers, inheritance, score, semantic relevance). This is a specific verb+resource and distinct from sibling tools like 'rank_nodes' or 'query_ranked', though it does not explicitly name them.

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?

There is no guidance on when to use this tool versus alternatives. It describes the tool's behavior but never mentions when to prefer it over siblings like 'rank_nodes' or 'query_ranked', nor any exclusion conditions. The only conditional is about the 'q' parameter, which is not about tool selection.

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