Skip to content

Add ToolRegistry and MCP tools search handler - #17

Draft
binrogithub wants to merge 1 commit into
masterfrom
codex/create-toolregistry-module-and-hc_tools_search-handler
Draft

Add ToolRegistry and MCP tools search handler#17
binrogithub wants to merge 1 commit into
masterfrom
codex/create-toolregistry-module-and-hc_tools_search-handler

Conversation

@binrogithub

Copy link
Copy Markdown
Owner

Motivation

  • Provide a single authoritative place to declare tool metadata and schemas to avoid duplicated schema definitions across the codebase.
  • Make tool discovery deterministic and stable for MCP consumers by producing a canonical catalog view of tools.

Description

  • Add hc_agent/core/tool_registry.py with a frozen ToolSpec dataclass and a ToolRegistry class that stores registered tools and exposes a deterministic schema() method.
  • Ensure ToolRegistry.schema() sorts tools by name, deep-copies serialized entries, and converts examples to lists to produce stable, JSON-friendly output.
  • Add hc_agent/mcp/tools.py with hc_tools_search() that builds the MCP-facing catalog from ToolRegistry.schema() and returns {name, description, risk, input_schema, output_schema, examples} for each tool.
  • Create package scaffolding files hc_agent/__init__.py, hc_agent/core/__init__.py, and hc_agent/mcp/__init__.py to expose the new modules.

Testing

  • No automated tests were run on these changes.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant