Skip to content

feat: Add get_tool_info function for better tool discoverability#28

Merged
mrsimpson merged 3 commits into
codemcp:mainfrom
raifdmueller:feature/issue-24-get-tool-info
Jul 11, 2025
Merged

feat: Add get_tool_info function for better tool discoverability#28
mrsimpson merged 3 commits into
codemcp:mainfrom
raifdmueller:feature/issue-24-get-tool-info

Conversation

@raifdmueller

Copy link
Copy Markdown
Contributor

Summary

Implements Issue #24 - Add get_tool_info function for better tool discoverability and improved user experience.

What's Changed

New Handler Implementation

  • Added GetToolInfoHandler in src/server/tool-handlers/get-tool-info.ts
    • Extends BaseToolHandler for consistency with existing patterns
    • Returns comprehensive JSON response with tool information
    • Includes current workflow state when available
    • Follows existing logging and error handling patterns

Integration Updates

  • Updated tool registry in src/server/tool-handlers/index.ts

    • Import and register GetToolInfoHandler
    • Export handler class and types for external use
  • Added MCP tool registration in src/server/server-config.ts

    • Register get_tool_info tool with proper schema
    • Set appropriate annotations (readOnly, idempotent)
    • Follow same pattern as other tool registrations

Features

The new get_tool_info() function provides:

  • Complete tool inventory: Information about all 7 available tools (including itself)
  • Workflow overview: All 7 available workflows with descriptions and phases
  • Core concepts: Phase management, plan file tracking, conversation context
  • Usage guidelines: Required patterns, phase transitions, context requirements
  • Current state: Active workflow state when available (optional)

API Response Format

{
  "tool_name": "Responsible Vibe MCP - Development Workflow Management",
  "version": "1.0.0",
  "purpose": "Structured development workflows with guided phase transitions",
  "available_tools": [...],
  "available_workflows": [...],
  "core_concepts": {...},
  "usage_guidelines": {...},
  "workflow_states": {...}
}

Benefits

  1. Improved Discoverability: Users can quickly understand all available functions
  2. Better AI Integration: AI assistants can self-discover capabilities
  3. Standardization: Follows established MCP patterns used by other servers
  4. Reduced Learning Curve: Clear documentation of concepts and usage patterns
  5. Debugging Support: Current status information helps troubleshoot issues

Implementation Quality

  • ✅ Follows existing BaseToolHandler pattern
  • ✅ Consistent with other tool handlers (list-workflows.ts, etc.)
  • ✅ Proper error handling and logging
  • ✅ No breaking changes to existing functionality
  • ✅ Comprehensive response format for easy parsing

Testing

The implementation has been tested for:

  • ✅ Proper handler registration in tool registry
  • ✅ MCP server tool registration
  • ✅ Response format consistency
  • ✅ Integration with existing codebase

Ready for integration and further testing with MCP clients.

Related

Fixes #24

Implements comprehensive tool information handler following existing patterns:
- Extends BaseToolHandler with proper error handling and logging
- Provides detailed information about all available tools and workflows
- Includes core concepts, usage guidelines, and current workflow state
- Follows same pattern as list-workflows.ts for consistency
- Returns structured JSON response for easy parsing by AI assistants

Addresses Issue codemcp#24 requirements for better tool discoverability.
- Import GetToolInfoHandler
- Register 'get_tool_info' in createToolRegistry function
- Export handler class and types for external use
- Follows same pattern as other handlers for consistency
- Register get_tool_info tool in registerMcpTools function
- Provide comprehensive description for tool discoverability  
- Set appropriate annotations (readOnly, idempotent)
- Follow same pattern as other tool registrations
- No input schema required (no parameters)

Addresses Issue codemcp#24 requirement for better tool discoverability.
@mrsimpson mrsimpson changed the title Add get_tool_info function for better tool discoverability feat: Add get_tool_info function for better tool discoverability Jul 11, 2025
@mrsimpson mrsimpson merged commit 2b76b15 into codemcp:main Jul 11, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add get_tool_info function for better tool discoverability

2 participants