Skip to main content
Glama
Flux-Frontiers

SwiftKG MCP Server

centrality

Identifies structurally critical functions, types, and modules in a Swift codebase using weighted PageRank over the call graph, helping prioritize code review, refactoring, and test coverage.

Instructions

Compute Structural Importance Ranking (SIR) for the indexed codebase.

Runs a deterministic weighted PageRank over the sym-stub-resolved call graph. Edge weights are tuned per relation type (CALLS > INHERITS/CONFORMS/EXTENDS > IMPORTS > CONTAINS) and amplified for cross-module links; private symbols receive a post-convergence penalty. Scores are normalized to sum to 1.0.

Use this to:

  • Identify the most structurally critical functions, types, and protocols

  • Understand which modules are most depended upon

  • Prioritize code review, refactoring, or test coverage efforts

:param top: Maximum number of ranked entries to return (default 20). :param kinds: Comma-separated node kinds to include: module, class, struct, protocol, actor, function, method. Empty string returns all kinds. Ignored when group_by='module' (all kinds contribute to module aggregation). :param group_by: node (default) returns individual node rankings with score, inbound edge count, and cross-module inbound count; module aggregates node scores per module. :return: Markdown-formatted ranking table.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNo
kindsNo
group_byNonode

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden of behavioral disclosure, and it does so thoroughly. It explains determinism, relation-type edge weighting, cross-module amplification, the private-symbol penalty, score normalization, and the difference between node and module aggregation. This gives an agent a clear model of how the computation behaves beyond a simple 'rank nodes' statement.

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-structured: a concise definition, a compact algorithm paragraph, three use-case bullets, and parameter/return documentation. There is no filler, and the length is justified because the schema supplies no parameter descriptions.

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?

Given three optional parameters, no annotations, and no schema descriptions, the description covers the algorithm, use cases, parameter semantics, and return format. It is self-contained enough for an agent to decide when to invoke it and how to set arguments correctly.

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?

The schema provides zero description coverage, so the description must fully explain the parameters. It documents top's default, kinds' accepted values and empty-string behavior, and group_by's two modes with their output differences. It also notes that kinds is ignored when group_by='module', which is exactly the kind of semantic detail an agent needs.

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 operation ('Compute Structural Importance Ranking (SIR) for the indexed codebase') and specifies the algorithm ('deterministic weighted PageRank over the sym-stub-resolved call graph'). It identifies the resource and output type, but it does not explicitly contrast itself with sibling ranking tools such as rank_nodes or query_ranked, so differentiation is implicit rather than explicit.

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?

A dedicated 'Use this to' section provides three concrete use cases: identifying critical symbols, understanding depended-on modules, and prioritizing review/refactoring/test efforts. However, it does not state when not to use this tool or name alternative sibling tools, so exclusions and comparisons are absent.

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