Class: RailsAiBridge::Serializers::Providers::McpToolReferenceFormatter

Inherits:
Base
  • Object
show all
Defined in:
lib/rails_ai_bridge/serializers/providers/mcp_tool_reference_formatter.rb

Overview

Formats the static MCP Tool Reference section for rules-oriented output.

This shorter summary intentionally differs from Formatters::Providers::McpGuideFormatter, which is embedded in compact provider context files with tables and richer detail. Keep them aligned only when product or documentation requires a single canonical MCP description.

Instance Attribute Summary

Attributes inherited from Base

#context

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from RailsAiBridge::Serializers::Providers::Base

Instance Method Details

#callString

Renders the MCP Tool Reference section as a Markdown string.

Returns:

  • (String)

    The formatted MCP tool reference markdown.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/rails_ai_bridge/serializers/providers/mcp_tool_reference_formatter.rb', line 15

def call
  %{
## MCP Tool Reference

All introspection tools support detail:"summary"|"standard"|"full".
Start with summary, drill into specifics with a filter.

### rails_get_schema
Params: table, detail, limit, offset, format
- `rails_get_schema(detail:"summary")` — all tables with column counts
- `rails_get_schema(table:"users")` — full detail for one table
- `rails_get_schema(detail:"summary", limit:20, offset:40)` — paginate

### rails_get_model_details
Params: model, detail
- `rails_get_model_details(detail:"summary")` — list model names
- `rails_get_model_details(model:"User")` — full associations, validations, scopes

### rails_get_routes
Params: controller, detail, limit, offset
- `rails_get_routes(detail:"summary")` — route counts per controller
- `rails_get_routes(controller:"users")` — routes for one controller

### rails_get_controllers
Params: controller, detail
- `rails_get_controllers(detail:"summary")` — names + action counts
- `rails_get_controllers(controller:"UsersController")` — full detail

### Other tools
- `rails_get_config` — cache, session, middleware, timezone
- `rails_get_test_info` — framework, factories, CI
- `rails_get_gems` — categorized gem analysis
- `rails_get_conventions` — architecture patterns
- `rails_search_code(pattern:"regex", file_type:"rb", max_results:20)` — codebase search
}
end