Skip to content

[Epic] Phase 2: Claude Tool Use & NL-to-SQL (Function Calling) #15

Description

@Mullassery

Phase 2: Claude Tool Use Implementation (Weeks 3-5)

Priority: HIGH
Duration: 2-3 weeks
Estimate: 35 hours

Focus: Enable Claude to call MCP tools and generate SQL from natural language

Key Deliverables

  • ✅ Claude can call MCP tools
  • ✅ Tool results loop back to Claude
  • ✅ NL-to-SQL generation (80-85% accuracy)
  • ✅ Query error recovery
  • ✅ 15+ comprehensive tests

Tasks

2.1 Backend: Claude Tool Calling

  • Modify Claude API request format (add tool definitions)
  • Implement tool_use response handling
  • Implement tool execution loop
  • Add error recovery

2.2 Frontend: Tool Integration

  • Connect Claude requests to MCP tools
  • Update AIAssistant UI to show tool usage
  • Display tool execution results

2.3 NL-to-SQL

  • Design NL-to-SQL system (few-shot prompts)
  • Implement Claude-based translation
  • Add schema context injection
  • Build query error recovery

2.4 Testing

  • Unit tests for tool calling (4+)
  • Integration tests (4+)
  • E2E tests with real Claude API (3+)
  • NL-to-SQL accuracy tests (4+)

2.5 Documentation

  • Update AI_MCP_INTEGRATION.md
  • Add NL-to-SQL examples
  • Document tool calling workflow

Success Criteria

  • ✅ Claude correctly calls tools
  • ✅ 15+ tests passing
  • ✅ NL-to-SQL accuracy >80%
  • ✅ <500ms tool execution time
  • ✅ Zero tool calling failures

Related

Activity

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

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