yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
tool_schemas.h
Go to the documentation of this file.
1
9#ifndef YAZE_SRC_CLI_SERVICE_AGENT_TOOL_SCHEMAS_H_
10#define YAZE_SRC_CLI_SERVICE_AGENT_TOOL_SCHEMAS_H_
11
12#include <string>
13#include <vector>
14
15#include "absl/strings/str_cat.h"
16#include "absl/strings/str_join.h"
17
18namespace yaze {
19namespace cli {
20namespace agent {
21
26 std::string name;
27 std::string type; // "string", "number", "boolean", "enum"
28 std::string description;
29 bool required = false;
30 std::string default_value;
31 std::vector<std::string> enum_values; // For enum type
32
33 std::string ToJson() const {
34 std::string json = "{";
35 json += "\"name\": \"" + name + "\", ";
36 json += "\"type\": \"" + type + "\", ";
37 json += "\"description\": \"" + description + "\", ";
38 json += "\"required\": " + std::string(required ? "true" : "false");
39 if (!default_value.empty()) {
40 json += ", \"default\": \"" + default_value + "\"";
41 }
42 if (!enum_values.empty()) {
43 json += ", \"enum\": [";
44 for (size_t i = 0; i < enum_values.size(); ++i) {
45 json += "\"" + enum_values[i] + "\"";
46 if (i < enum_values.size() - 1) json += ", ";
47 }
48 json += "]";
49 }
50 json += "}";
51 return json;
52 }
53};
54
58struct ToolSchema {
59 std::string name;
60 std::string category;
61 std::string description;
62 std::string detailed_help;
63 std::vector<ArgumentSchema> arguments;
64 std::vector<std::string> examples;
65 std::vector<std::string> related_tools;
66 bool requires_rom = true;
67 bool requires_grpc = false;
68
72 std::string ToJson() const {
73 std::string json = "{\n";
74 json += " \"name\": \"" + name + "\",\n";
75 json += " \"description\": \"" + description + "\",\n";
76 json += " \"category\": \"" + category + "\",\n";
77
78 // Parameters
79 json += " \"parameters\": {\n";
80 json += " \"type\": \"object\",\n";
81 json += " \"properties\": {\n";
82
83 for (size_t i = 0; i < arguments.size(); ++i) {
84 const auto& arg = arguments[i];
85 json += " \"" + arg.name + "\": {\n";
86 json += " \"type\": \"" + arg.type + "\",\n";
87 json += " \"description\": \"" + arg.description + "\"";
88 if (!arg.enum_values.empty()) {
89 json += ",\n \"enum\": [";
90 for (size_t j = 0; j < arg.enum_values.size(); ++j) {
91 json += "\"" + arg.enum_values[j] + "\"";
92 if (j < arg.enum_values.size() - 1) json += ", ";
93 }
94 json += "]";
95 }
96 json += "\n }";
97 if (i < arguments.size() - 1) json += ",";
98 json += "\n";
99 }
100
101 json += " },\n";
102
103 // Required arguments
104 json += " \"required\": [";
105 bool first = true;
106 for (const auto& arg : arguments) {
107 if (arg.required) {
108 if (!first) json += ", ";
109 json += "\"" + arg.name + "\"";
110 first = false;
111 }
112 }
113 json += "]\n";
114 json += " },\n";
115
116 // Additional metadata
117 json += " \"requires_rom\": " + std::string(requires_rom ? "true" : "false")
118 + ",\n";
119 json += " \"requires_grpc\": " +
120 std::string(requires_grpc ? "true" : "false");
121
122 if (!examples.empty()) {
123 json += ",\n \"examples\": [\n";
124 for (size_t i = 0; i < examples.size(); ++i) {
125 json += " \"" + examples[i] + "\"";
126 if (i < examples.size() - 1) json += ",";
127 json += "\n";
128 }
129 json += " ]";
130 }
131
132 if (!related_tools.empty()) {
133 json += ",\n \"related_tools\": [";
134 for (size_t i = 0; i < related_tools.size(); ++i) {
135 json += "\"" + related_tools[i] + "\"";
136 if (i < related_tools.size() - 1) json += ", ";
137 }
138 json += "]";
139 }
140
141 json += "\n}";
142 return json;
143 }
144
148 std::string ToMarkdown() const {
149 std::string md;
150 md += "### " + name + "\n\n";
151 md += description + "\n\n";
152
153 if (!detailed_help.empty()) {
154 md += detailed_help + "\n\n";
155 }
156
157 md += "**Category:** " + category + "\n\n";
158
159 if (!arguments.empty()) {
160 md += "**Arguments:**\n\n";
161 md += "| Name | Type | Required | Description |\n";
162 md += "|------|------|----------|-------------|\n";
163 for (const auto& arg : arguments) {
164 md += "| `" + arg.name + "` | " + arg.type + " | ";
165 md += (arg.required ? "Yes" : "No") + " | ";
166 md += arg.description + " |\n";
167 }
168 md += "\n";
169 }
170
171 if (!examples.empty()) {
172 md += "**Examples:**\n\n```bash\n";
173 for (const auto& ex : examples) {
174 md += ex + "\n";
175 }
176 md += "```\n\n";
177 }
178
179 if (!related_tools.empty()) {
180 md += "**Related:** " + absl::StrJoin(related_tools, ", ") + "\n\n";
181 }
182
183 return md;
184 }
185};
186
191 public:
193 static ToolSchemaRegistry instance;
194 return instance;
195 }
196
197 void Register(const ToolSchema& schema) { schemas_[schema.name] = schema; }
198
199 const ToolSchema* Get(const std::string& name) const {
200 auto it = schemas_.find(name);
201 return it != schemas_.end() ? &it->second : nullptr;
202 }
203
204 std::vector<ToolSchema> GetAll() const {
205 std::vector<ToolSchema> result;
206 for (const auto& [_, schema] : schemas_) {
207 result.push_back(schema);
208 }
209 return result;
210 }
211
212 std::vector<ToolSchema> GetByCategory(const std::string& category) const {
213 std::vector<ToolSchema> result;
214 for (const auto& [_, schema] : schemas_) {
215 if (schema.category == category) {
216 result.push_back(schema);
217 }
218 }
219 return result;
220 }
221
225 std::string ExportAllAsJson() const {
226 std::string json = "[\n";
227 bool first = true;
228 for (const auto& [_, schema] : schemas_) {
229 if (!first) json += ",\n";
230 json += schema.ToJson();
231 first = false;
232 }
233 json += "\n]";
234 return json;
235 }
236
240 std::string ExportAllAsMarkdown() const {
241 std::string md = "# Z3ED Tool Reference\n\n";
242
243 // Group by category
244 std::map<std::string, std::vector<const ToolSchema*>> by_category;
245 for (const auto& [_, schema] : schemas_) {
246 by_category[schema.category].push_back(&schema);
247 }
248
249 for (const auto& [category, tools] : by_category) {
250 md += "## " + category + "\n\n";
251 for (const auto* tool : tools) {
252 md += tool->ToMarkdown();
253 }
254 }
255
256 return md;
257 }
258
262 std::string GenerateLLMPrompt() const {
263 std::string prompt = "## Available Tools\n\n";
264 prompt +=
265 "You can call the following tools to interact with the ROM and "
266 "editor:\n\n";
267
268 for (const auto& [_, schema] : schemas_) {
269 prompt += "- **" + schema.name + "**: " + schema.description + "\n";
270 if (!schema.arguments.empty()) {
271 prompt += " Arguments: ";
272 for (size_t i = 0; i < schema.arguments.size(); ++i) {
273 const auto& arg = schema.arguments[i];
274 prompt += arg.name;
275 if (arg.required) prompt += "*";
276 if (i < schema.arguments.size() - 1) prompt += ", ";
277 }
278 prompt += "\n";
279 }
280 }
281
282 return prompt;
283 }
284
285 private:
287
289 // Meta-tools
290 Register({.name = "tools-list",
291 .category = "meta",
292 .description = "List all available tools",
293 .detailed_help = "Returns a JSON array of all tools the AI can "
294 "call, including their names, categories, and "
295 "brief descriptions.",
296 .arguments = {},
297 .examples = {"z3ed tools-list"},
298 .requires_rom = false});
299
300 Register({.name = "tools-describe",
301 .category = "meta",
302 .description = "Get detailed information about a specific tool",
303 .arguments = {{.name = "name",
304 .type = "string",
305 .description = "Name of the tool to describe",
306 .required = true}},
307 .examples = {"z3ed tools-describe --name=dungeon-describe-room"},
308 .requires_rom = false});
309
310 Register({.name = "tools-search",
311 .category = "meta",
312 .description = "Search tools by keyword",
313 .arguments = {{.name = "query",
314 .type = "string",
315 .description = "Search query",
316 .required = true}},
317 .examples = {"z3ed tools-search --query=sprite"},
318 .requires_rom = false});
319
320 // Resource tools
321 Register({.name = "resource-list",
322 .category = "resource",
323 .description = "List resource labels for a specific type",
324 .arguments = {{.name = "type",
325 .type = "string",
326 .description = "Resource type to list",
327 .required = true,
328 .enum_values = {"dungeon", "overworld", "sprite",
329 "palette", "message"}}},
330 .examples = {"z3ed resource-list --type=dungeon"},
331 .related_tools = {"resource-search"}});
332
333 // Dungeon tools
334 Register(
335 {.name = "dungeon-describe-room",
336 .category = "dungeon",
337 .description = "Get detailed description of a dungeon room",
338 .detailed_help =
339 "Returns information about room layout, objects, sprites, "
340 "and properties for the specified room ID.",
341 .arguments = {{.name = "room",
342 .type = "number",
343 .description = "Room ID (0-295)",
344 .required = true}},
345 .examples = {"z3ed dungeon-describe-room --room=5"},
346 .related_tools = {"dungeon-list-sprites", "dungeon-list-objects"}});
347
348 // Overworld tools
349 Register({.name = "overworld-describe-map",
350 .category = "overworld",
351 .description = "Get detailed description of an overworld map",
352 .arguments = {{.name = "map",
353 .type = "number",
354 .description = "Map ID (0-159)",
355 .required = true}},
356 .examples = {"z3ed overworld-describe-map --map=0"},
357 .related_tools = {"overworld-list-sprites", "overworld-find-tile"}});
358
359 // Filesystem tools
360 Register({.name = "filesystem-list",
361 .category = "filesystem",
362 .description = "List directory contents",
363 .arguments = {{.name = "path",
364 .type = "string",
365 .description = "Directory path to list",
366 .required = true}},
367 .examples = {"z3ed filesystem-list --path=src/app"},
368 .requires_rom = false,
369 .related_tools = {"filesystem-read", "filesystem-exists"}});
370
371 Register({.name = "filesystem-read",
372 .category = "filesystem",
373 .description = "Read file contents",
374 .arguments = {{.name = "path",
375 .type = "string",
376 .description = "File path to read",
377 .required = true},
378 {.name = "lines",
379 .type = "number",
380 .description = "Maximum lines to read",
381 .required = false,
382 .default_value = "100"}},
383 .examples = {"z3ed filesystem-read --path=src/app/rom.h"},
384 .requires_rom = false});
385
386 // Memory tools
387 Register({.name = "memory-regions",
388 .category = "memory",
389 .description = "List known ALTTP memory regions",
390 .detailed_help = "Returns a list of known memory regions in A "
391 "Link to the Past, including player state, "
392 "sprites, save data, and system variables.",
393 .arguments = {},
394 .examples = {"z3ed memory-regions"},
395 .requires_rom = false,
396 .related_tools = {"memory-analyze", "memory-search"}});
397
398 // Test helper tools
399 Register({.name = "tools-harness-state",
400 .category = "tools",
401 .description = "Generate WRAM state for test harnesses",
402 .detailed_help =
403 "Runs the emulator to the main game loop and dumps the "
404 "complete WRAM state and register values to a C++ header "
405 "file for use in test harnesses.",
406 .arguments = {{.name = "rom",
407 .type = "string",
408 .description = "Path to ROM file",
409 .required = true},
410 {.name = "output",
411 .type = "string",
412 .description = "Output header file path",
413 .required = true}},
414 .examples = {"z3ed tools-harness-state --rom=zelda3.sfc "
415 "--output=harness_state.h"},
416 .requires_rom = false});
417
418 Register({.name = "tools-extract-golden",
419 .category = "tools",
420 .description = "Extract comprehensive golden data from ROM",
421 .arguments = {{.name = "rom",
422 .type = "string",
423 .description = "Path to ROM file",
424 .required = true},
425 {.name = "output",
426 .type = "string",
427 .description = "Output header file path",
428 .required = true}},
429 .examples = {"z3ed tools-extract-golden --rom=zelda3.sfc "
430 "--output=golden_data.h"}});
431
432 // Visual analysis tools
433 Register({.name = "visual-find-similar-tiles",
434 .category = "visual",
435 .description = "Find tiles with similar patterns to a reference",
436 .detailed_help =
437 "Compares a reference tile against all tiles in graphics "
438 "sheets and returns matches above the similarity threshold. "
439 "Useful for finding duplicate or near-duplicate tiles for "
440 "ROM optimization.",
441 .arguments = {{.name = "tile_id",
442 .type = "number",
443 .description = "Reference tile ID to compare",
444 .required = true},
445 {.name = "sheet",
446 .type = "number",
447 .description = "Graphics sheet index (0-222)",
448 .required = false,
449 .default_value = "0"},
450 {.name = "threshold",
451 .type = "number",
452 .description = "Minimum similarity score (0-100)",
453 .required = false,
454 .default_value = "80"},
455 {.name = "method",
456 .type = "string",
457 .description = "Comparison method",
458 .required = false,
459 .default_value = "structural",
460 .enum_values = {"pixel", "structural"}}},
461 .examples = {"z3ed visual-find-similar-tiles --tile_id=42",
462 "z3ed visual-find-similar-tiles --tile_id=10 "
463 "--sheet=5 --threshold=90"},
464 .related_tools = {"visual-analyze-spritesheet",
465 "visual-tile-histogram"}});
466
467 Register({.name = "visual-analyze-spritesheet",
468 .category = "visual",
469 .description = "Identify unused regions in graphics sheets",
470 .detailed_help =
471 "Scans graphics sheets for contiguous empty regions that "
472 "can be used for custom graphics in ROM hacking. Reports "
473 "the location and size of each free region.",
474 .arguments = {{.name = "sheet",
475 .type = "number",
476 .description = "Specific sheet to analyze (all if omitted)",
477 .required = false},
478 {.name = "tile_size",
479 .type = "number",
480 .description = "Tile size to check (8 or 16)",
481 .required = false,
482 .default_value = "8",
483 .enum_values = {"8", "16"}}},
484 .examples = {"z3ed visual-analyze-spritesheet",
485 "z3ed visual-analyze-spritesheet --sheet=10 "
486 "--tile_size=16"},
487 .related_tools = {"visual-find-similar-tiles"}});
488
489 Register({.name = "visual-palette-usage",
490 .category = "visual",
491 .description = "Analyze palette usage statistics across maps",
492 .detailed_help =
493 "Analyzes which palette indices are used across overworld "
494 "maps and dungeon rooms. Helps identify under-utilized "
495 "palettes and optimization opportunities.",
496 .arguments = {{.name = "type",
497 .type = "string",
498 .description = "Map type to analyze",
499 .required = false,
500 .default_value = "all",
501 .enum_values = {"overworld", "dungeon", "all"}}},
502 .examples = {"z3ed visual-palette-usage",
503 "z3ed visual-palette-usage --type=dungeon"},
504 .related_tools = {"visual-tile-histogram"}});
505
506 Register({.name = "visual-tile-histogram",
507 .category = "visual",
508 .description = "Generate frequency histogram of tile usage",
509 .detailed_help =
510 "Counts the frequency of each tile ID used across tilemaps "
511 "to identify commonly and rarely used tiles. Useful for "
512 "understanding tile distribution and finding candidates "
513 "for replacement.",
514 .arguments = {{.name = "type",
515 .type = "string",
516 .description = "Map type to analyze",
517 .required = false,
518 .default_value = "overworld",
519 .enum_values = {"overworld", "dungeon"}},
520 {.name = "top",
521 .type = "number",
522 .description = "Number of top entries to return",
523 .required = false,
524 .default_value = "20"}},
525 .examples = {"z3ed visual-tile-histogram",
526 "z3ed visual-tile-histogram --type=dungeon --top=50"},
527 .related_tools = {"visual-palette-usage",
528 "visual-find-similar-tiles"}});
529
530 // =========================================================================
531 // Code Generation Tools
532 // =========================================================================
533
534 Register({.name = "codegen-asm-hook",
535 .category = "codegen",
536 .description = "Generate ASM hook at ROM address",
537 .detailed_help =
538 "Generates Asar-compatible ASM code to hook into the ROM at "
539 "a specified address using JSL. Validates the address is safe "
540 "and not already hooked. Includes known safe hook locations.",
541 .arguments = {{.name = "address",
542 .type = "hex",
543 .description = "ROM address to hook (hex)",
544 .required = true},
545 {.name = "label",
546 .type = "string",
547 .description = "Label name for the hook",
548 .required = true},
549 {.name = "nop-fill",
550 .type = "number",
551 .description = "Number of NOP bytes to add",
552 .required = false,
553 .default_value = "1"}},
554 .examples = {"z3ed codegen-asm-hook --address=0x02AB08 --label=MyHook",
555 "z3ed codegen-asm-hook --address=0x00893D --label=ForceBlankHook --nop-fill=2"},
556 .requires_rom = true,
557 .related_tools = {"codegen-freespace-patch", "memory-analyze"}});
558
559 Register({.name = "codegen-freespace-patch",
560 .category = "codegen",
561 .description = "Generate patch using detected free regions",
562 .detailed_help =
563 "Detects available freespace in the ROM (regions with >80% "
564 "0x00/0xFF bytes) and generates a patch to allocate space "
565 "for custom code. Returns available regions and generated ASM.",
566 .arguments = {{.name = "label",
567 .type = "string",
568 .description = "Label for the code block",
569 .required = true},
570 {.name = "size",
571 .type = "hex",
572 .description = "Size in bytes needed (hex)",
573 .required = true},
574 {.name = "prefer-bank",
575 .type = "hex",
576 .description = "Preferred bank number (hex)",
577 .required = false}},
578 .examples = {"z3ed codegen-freespace-patch --label=MyCode --size=0x100",
579 "z3ed codegen-freespace-patch --label=CustomRoutine --size=0x200 --prefer-bank=0x3F"},
580 .requires_rom = true,
581 .related_tools = {"codegen-asm-hook", "memory-regions"}});
582
583 Register({.name = "codegen-sprite-template",
584 .category = "codegen",
585 .description = "Generate sprite ASM from template",
586 .detailed_help =
587 "Generates a complete sprite ASM template with init and main "
588 "state machine. Includes SNES sprite variable documentation "
589 "and proper PHB/PLB register preservation.",
590 .arguments = {{.name = "name",
591 .type = "string",
592 .description = "Sprite name/label",
593 .required = true},
594 {.name = "init-code",
595 .type = "string",
596 .description = "Initialization ASM code",
597 .required = false},
598 {.name = "main-code",
599 .type = "string",
600 .description = "Main loop ASM code",
601 .required = false}},
602 .examples = {"z3ed codegen-sprite-template --name=MySprite",
603 "z3ed codegen-sprite-template --name=CustomChest --init-code=\"LDA #$42 : STA $0DC0,X\""},
604 .requires_rom = false,
605 .related_tools = {"codegen-event-handler"}});
606
607 Register({.name = "codegen-event-handler",
608 .category = "codegen",
609 .description = "Generate event handler code",
610 .detailed_help =
611 "Generates ASM event handler code for NMI, IRQ, or Reset "
612 "handlers. Includes proper state preservation and known "
613 "hook addresses for each event type.",
614 .arguments = {{.name = "type",
615 .type = "string",
616 .description = "Event type",
617 .required = true,
618 .enum_values = {"nmi", "irq", "reset"}},
619 {.name = "label",
620 .type = "string",
621 .description = "Handler label name",
622 .required = true},
623 {.name = "custom-code",
624 .type = "string",
625 .description = "Custom ASM code",
626 .required = false}},
627 .examples = {"z3ed codegen-event-handler --type=nmi --label=MyVBlank",
628 "z3ed codegen-event-handler --type=nmi --label=MyHandler --custom-code=\"LDA #$80 : STA $2100\""},
629 .requires_rom = false,
630 .related_tools = {"codegen-asm-hook", "codegen-sprite-template"}});
631
632 // =========================================================================
633 // Project Management Tools
634 // =========================================================================
635
636 Register({.name = "project-status",
637 .category = "project",
638 .description = "Show current project state and pending edits",
639 .detailed_help =
640 "Displays current project state including loaded ROM info, "
641 "pending uncommitted edits, available snapshots, and ROM "
642 "checksum for validation.",
643 .arguments = {},
644 .examples = {"z3ed project-status"},
645 .requires_rom = true,
646 .related_tools = {"project-snapshot", "project-restore"}});
647
648 Register({.name = "project-snapshot",
649 .category = "project",
650 .description = "Create named checkpoint with edit deltas",
651 .detailed_help =
652 "Creates a named snapshot storing all pending edits as "
653 "deltas (not full ROM copy). Includes ROM checksum for "
654 "validation when restoring.",
655 .arguments = {{.name = "name",
656 .type = "string",
657 .description = "Snapshot name",
658 .required = true},
659 {.name = "description",
660 .type = "string",
661 .description = "Optional description",
662 .required = false}},
663 .examples = {"z3ed project-snapshot --name=before-edit",
664 "z3ed project-snapshot --name=dungeon-complete --description=\"Finished dungeon 1\""},
665 .requires_rom = true,
666 .related_tools = {"project-status", "project-restore", "project-diff"}});
667
668 Register({.name = "project-restore",
669 .category = "project",
670 .description = "Restore ROM to named checkpoint",
671 .detailed_help =
672 "Restores the ROM to a previously saved snapshot state by "
673 "replaying the stored edit deltas. Validates ROM checksum "
674 "to ensure correct base ROM.",
675 .arguments = {{.name = "name",
676 .type = "string",
677 .description = "Snapshot name to restore",
678 .required = true}},
679 .examples = {"z3ed project-restore --name=before-edit"},
680 .requires_rom = true,
681 .related_tools = {"project-snapshot", "project-status"}});
682
683 Register({.name = "project-export",
684 .category = "project",
685 .description = "Export project as portable archive",
686 .detailed_help =
687 "Exports the project metadata and all snapshots as a "
688 "portable archive file. Optionally includes the base ROM.",
689 .arguments = {{.name = "path",
690 .type = "string",
691 .description = "Output file path",
692 .required = true},
693 {.name = "include-rom",
694 .type = "flag",
695 .description = "Include base ROM in export",
696 .required = false}},
697 .examples = {"z3ed project-export --path=myproject.tar.gz",
698 "z3ed project-export --path=backup.tar.gz --include-rom"},
699 .requires_rom = true,
700 .related_tools = {"project-import"}});
701
702 Register({.name = "project-import",
703 .category = "project",
704 .description = "Import project archive",
705 .detailed_help =
706 "Imports a project archive and loads its metadata and "
707 "snapshots. Validates project structure and checksums.",
708 .arguments = {{.name = "path",
709 .type = "string",
710 .description = "Archive file path",
711 .required = true}},
712 .examples = {"z3ed project-import --path=myproject.tar.gz"},
713 .requires_rom = false,
714 .related_tools = {"project-export"}});
715
716 Register({.name = "project-diff",
717 .category = "project",
718 .description = "Compare two project states",
719 .detailed_help =
720 "Compares two snapshots and shows the differences in edits "
721 "between them. Useful for reviewing changes between versions.",
722 .arguments = {{.name = "snapshot1",
723 .type = "string",
724 .description = "First snapshot name",
725 .required = true},
726 {.name = "snapshot2",
727 .type = "string",
728 .description = "Second snapshot name",
729 .required = true}},
730 .examples = {"z3ed project-diff --snapshot1=v1 --snapshot2=v2"},
731 .requires_rom = true,
732 .related_tools = {"project-snapshot", "rom-diff"}});
733 }
734
735 std::map<std::string, ToolSchema> schemas_;
736};
737
738} // namespace agent
739} // namespace cli
740} // namespace yaze
741
742#endif // YAZE_SRC_CLI_SERVICE_AGENT_TOOL_SCHEMAS_H_
743
Registry of all tool schemas.
std::map< std::string, ToolSchema > schemas_
std::vector< ToolSchema > GetByCategory(const std::string &category) const
std::string ExportAllAsJson() const
Export all schemas as JSON array for function calling APIs.
std::string GenerateLLMPrompt() const
Generate LLM system prompt section for tools.
std::vector< ToolSchema > GetAll() const
static ToolSchemaRegistry & Instance()
void Register(const ToolSchema &schema)
std::string ExportAllAsMarkdown() const
Export all schemas as Markdown documentation.
const ToolSchema * Get(const std::string &name) const
Argument schema for a tool parameter.
std::vector< std::string > enum_values
Complete tool schema for LLM documentation.
std::vector< ArgumentSchema > arguments
std::string ToJson() const
Generate JSON schema for function calling APIs.
std::vector< std::string > examples
std::vector< std::string > related_tools
std::string ToMarkdown() const
Generate markdown documentation for a tool.