Skip to content

feat(mpp-idea): Integrate ToolchainFunctionProvider with mpp-core Tool system #502

@phodal

Description

@phodal

Summary

Integrate IntelliJ IDEA's ToolchainFunctionProvider extension point with mpp-core's ToolOrchestrator and ToolRegistry system.

Background

Currently, mpp-idea has its own tool extension mechanism via ToolchainFunctionProvider (IntelliJ Extension Point), which includes:

  • DatabaseFunctionProvider - Database schema and query tools
  • KnowledgeFunctionProvider - API call chain analysis
  • ComponentViewFunctionProvider - UI component analysis
  • HistoryFunctionProvider - Code history analysis
  • McpFunctionProvider - MCP integration

Meanwhile, mpp-core has a unified tool system with:

  • Tool / ExecutableTool<TParams, TResult> interfaces
  • ToolRegistry for tool management
  • ToolProvider interface for tool discovery
  • ToolOrchestrator for tool execution

Goal

Create an adapter layer to bridge these two systems, allowing IDEA-specific tools to be used by CodingAgent through the unified ToolOrchestrator.

Implementation Plan

  1. ToolchainFunctionAdapter - Wraps ToolchainFunctionProvider as ExecutableTool
  2. IdeaToolProvider - Implements ToolProvider to collect all ToolchainFunctionProvider extensions
  3. Integration - Register IdeaToolProvider when creating CodingAgent in IDEA

Architecture

ToolchainFunctionProvider (IDEA Extension)
         ↓
ToolchainFunctionAdapter (wraps as ExecutableTool)
         ↓
IdeaToolProvider (implements ToolProvider)
         ↓
ToolProviderRegistry → ToolRegistry → ToolOrchestrator → CodingAgent

Files to Create/Modify

  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/tool/ToolchainFunctionAdapter.kt
  • mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/tool/IdeaToolProvider.kt
  • Modify IdeaAgentViewModel.kt to register IDEA tools

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions