Pudu programming language
Menu
Package

@chrismichaelps / pudu-lang-mcp

Model Context Protocol server for Pudu language documentation and compiler tools

0.1.1Apache-2.01

InstallClose

Reference.md

Markdown66 lines2.0 KB

GitHub ↗

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 with Entry.search; each hit renders its declaration and documentation.
  • moduleText: find the module's file; unknown is NotFound, suggesting up to eight module names that contain the query case-insensitively. Otherwise moduleEntries rendered with Entry.renderModule, bounded to DOC_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; module is a keyword, so the handler is moduleTool and the tool name stays pudu_module_reference.

Referenced by

[[src/PuduLangMcp/App/Tools/_MOC]]