Skip to main content
Glama
Flux-Frontiers

SwiftKG MCP Server

query_ranked

Ranks natural-language query results by combining semantic vector scores with graph centrality and proximity, using hybrid or personalized PageRank modes. Returns explainable ranked lists for Swift codebase knowledge graph queries.

Instructions

Rank query results using CodeRank-enhanced hybrid or personalized PageRank.

Combines semantic seed scores from the vector index with structural centrality and graph proximity to produce a final ranked list with explainability components.

Two modes are available:

  • hybrid (default): 0.60 × semantic + 0.25 × centrality + 0.15 × proximity

  • ppr: 0.70 × personalized PageRank + 0.30 × semantic

:param q: Natural-language query string. :param k: Number of semantic seed nodes to retrieve (default 8). :param mode: Ranking mode — "hybrid" (default) or "ppr". :param top: Maximum ranked results to return (default 25). :param rels: Comma-separated relations to include in the local graph. :param radius: Graph expansion radius around seeds (default 2). :param exclude_tests: Exclude test-path nodes (default True). :return: JSON array of ranked result dicts with score components and why explanation strings. sym: import stub nodes are always excluded from the output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNo
qYes
topNo
modeNohybrid
relsNoCALLS,IMPORTS,INHERITS,CONFORMS,EXTENDS
radiusNo
exclude_testsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden, and it does well: it discloses the combination formula, mode weights, that 'sym:' import stub nodes are always excluded, and that output is a JSON array with score components and 'why' strings. It does not explicitly state read-only behavior, but 'query' plus the detailed output contract makes behavioral expectations reasonably transparent.

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 and front-loaded: the first sentence states the tool's purpose, the mode formulas add precise algorithmic context, and the parameter list is compact and informative. Every sentence contributes meaningful information without unnecessary filler.

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?

For a tool with 7 parameters, no annotations, and an output schema, the description is remarkably complete: it explains the algorithm, mode weighting, parameter meanings, return format, and output exclusions. An agent has enough information to invoke the tool correctly and interpret its results.

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 fully compensates by documenting every parameter: q, k, mode, top, rels, radius, and exclude_tests, including defaults and semantic meaning. It also clarifies mode choices and the rels format beyond what the bare schema provides.

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 states a specific action ('Rank query results') and resource ('using CodeRank-enhanced hybrid or personalized PageRank'), making the tool's core purpose immediately clear. It gives algorithmic detail and modes, but does not explicitly contrast it with sibling tools like rank_nodes or explain_rank, so it lacks explicit sibling differentiation.

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

Usage Guidelines3/5

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

The description implies usage for natural-language query ranking and explains when to choose 'hybrid' vs 'ppr' modes by giving default weights and semantics. However, it does not state when to prefer this tool over alternatives such as query_codebase, rank_nodes, or explain_rank, so usage guidance is implied rather than explicit.

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