Skip to main content
Glama
Flux-Frontiers

SwiftKG MCP Server

pack_snippets

Extract source-grounded Swift code snippets by natural-language query, returning a ranked, deduplicated Markdown pack with line numbers for direct LLM ingestion.

Instructions

Hybrid query + source-grounded Swift snippet extraction.

Returns a Markdown context pack with ranked, deduplicated code snippets and line numbers — ready for direct LLM ingestion.

:param q: Natural-language query, e.g. "request error handling". :param k: Number of semantic seed nodes (default 8). :param hop: Graph expansion hops (default 1). :param rels: Comma-separated edge types to follow. :param context: Extra context lines around each definition (default 5). :param max_lines: Maximum lines per snippet block (default 60). :param max_nodes: Maximum nodes to include in the pack (default 15). :param min_score: Minimum semantic score for seed inclusion in [0, 1]. :param max_per_module: Maximum nodes per module (default 3; 0 disables). :param rerank_mode: 'hybrid' (default), 'semantic', or 'legacy'. :param rerank_semantic_weight: Semantic weight for hybrid mode (default 0.7). :param rerank_lexical_weight: Lexical weight for hybrid mode (default 0.3). :return: Markdown string with source-grounded code snippets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNo
qYes
hopNo
relsNoCONTAINS,CALLS,IMPORTS,INHERITS,CONFORMS,EXTENDS
contextNo
max_linesNo
max_nodesNo
min_scoreNo
rerank_modeNohybrid
max_per_moduleNo
rerank_lexical_weightNo
rerank_semantic_weightNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the burden, and it does disclose the key behavior: it returns a Markdown string, performs hybrid ranking, deduplicates snippets, and grounds them in source with line numbers. It does not explicitly state read-only/no side effects, but 'Returns' and 'extraction' strongly imply a non-mutating query.

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 summary is front-loaded and each param line is compact and information-dense; no sentence is wasted. For a 12-parameter tool, this is appropriately sized and well structured.

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 high complexity and no annotations, the description covers what the tool returns, how the query/rerank process works, and every tunable parameter. An agent has enough information to invoke it correctly without opening schemas or sibling definitions.

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 tool would be opaque without param docs; the description compensates fully by explaining all 12 parameters, including defaults, valid choices for rerank_mode, the [0,1] range for min_score, and the 0-disables behavior for max_per_module.

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 line identifies a specific operation: hybrid query and source-grounded Swift snippet extraction, and the next sentence specifies the exact output (Markdown context pack of ranked, deduplicated snippets with line numbers). This clearly distinguishes it from sibling graph-query tools such as query_codebase or get_node.

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 phrase 'ready for direct LLM ingestion' gives a clear use case for choosing this tool, and the parameter list implies it is for rich, graph-expanded snippet retrieval. It does not explicitly name alternatives or state when not to use it, so it falls short of a 5.

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