Reference.md
Reference tools
type: module path: "@root/src/PuduLangMcp/App/Tools/Reference.pudu" fidelity: Active domain: "[[domain/Tool]]" grammar: "[[grammar/pudu]]" depth_score: 0.45 depth_status: MODERATE coupling: 5 interface_stability: 0.8 tags: [module] aliases: [Reference Tools]
Purpose
pudu_reference_search and pudu_module_reference, answered from the installed toolchain ([[decisions/ADR-0006-reference-from-toolchain]]).
Interface
Signatures
export fn search(context: &Context.Context, args: &Arguments.Args) -> Result[Str, ToolError.ToolFailure]
export fn moduleTool(context: &Context.Context, args: &Arguments.Args) -> Result[Str, ToolError.ToolFailure]
export fn moduleText(context: &Context.Context, moduleName: Str) -> Result[Str, ToolError.ToolFailure]Linkage
- Requires: [[src/PuduLangMcp/App/Context]], [[src/PuduLangMcp/Services/Reference]], [[src/PuduLangMcp/Domain/Reference/Entry]], [[src/PuduLangMcp/Domain/Catalog/Arguments]], [[src/PuduLangMcp/Utils/TextBounds]].
- Consumed by: [[src/PuduLangMcp/App/Tools/Registry]], [[src/PuduLangMcp/App/Resources]].
Algorithm
search: a query containing->is a type shape:pudu search <query> <every module file>, whose output is answered as is, bounded. Otherwise the index ([[src/PuduLangMcp/App/Context]]entries) is ranked withEntry.search; each hit renders its declaration and documentation.moduleText: find the module's file; unknown isNotFound, suggesting up to eight module names that contain the query case-insensitively. OtherwisemoduleEntriesrendered withEntry.renderModule, bounded toDOC_CHARS.
Negative Logic (Prohibited Paths)
- Never answers a declaration the compiler does not report as public.
Edge Cases
- A shape search with no match answers the compiler's own "no match" text.
Depth
DEPTH 0.45.
Grill Log
- Q: Why is the module handler named
module? A: It is not;moduleis a keyword, so the handler ismoduleTooland the tool name stayspudu_module_reference.
Referenced by
[[src/PuduLangMcp/App/Tools/_MOC]]
