Find class across project dependencies #13

Open
opened 2026-01-05 21:13:04 +00:00 by mprihoda · 0 comments
mprihoda commented 2026-01-05 21:13:04 +00:00 (Migrated from github.com)

Problem

Agent sees a type like Ref[IO, Map[K, V]] in code and needs to:

  1. Understand what it is
  2. Look up its documentation
  3. But doesn't know the coordinates

Currently must guess: "Is Ref from cats-effect? ZIO? Something else?"

Proposed Solution

New Tool: find_class

{
  "name": "find_class",
  "description": "Find which dependency provides a class",
  "input": {
    "className": "Simple or fully qualified class name",
    "projectPath": "optional, for project-aware search"
  }
}

Example queries:

  • find_class("Ref") → Multiple matches, ranked by likelihood
  • find_class("cats.effect.Ref") → Exact match
  • find_class("IO") → Shows cats-effect.IO, zio.IO, etc.

Returns:

{
  "matches": [
    {
      "className": "cats.effect.kernel.Ref",
      "coordinates": "org.typelevel::cats-effect:3.5.4",
      "inProject": true,
      "confidence": "high"
    },
    {
      "className": "zio.Ref", 
      "coordinates": "dev.zio::zio:2.1.0",
      "inProject": false,
      "confidence": "medium"
    }
  ]
}

Dependencies

  • Requires #12 (build tool integration) for project-aware search
  • Can work standalone with explicit coordinates

Implementation Options

  1. Index project deps only: Fast, limited scope
  2. Index + Maven Central search: Broader but slower
  3. Pre-built index of common libraries: Good balance

Value for Agent

  • Eliminates "which artifact?" guessing
  • Can directly proceed to get_documentation with correct coordinates
  • Understands if a class is from project deps or external

Acceptance Criteria

  • Find class by simple name within project dependencies
  • Find class by fully qualified name
  • Rank results (project deps first, then by popularity)
  • Return coordinates ready for get_documentation
## Problem Agent sees a type like `Ref[IO, Map[K, V]]` in code and needs to: 1. Understand what it is 2. Look up its documentation 3. But doesn't know the coordinates Currently must guess: "Is `Ref` from cats-effect? ZIO? Something else?" ## Proposed Solution ### New Tool: `find_class` ```json { "name": "find_class", "description": "Find which dependency provides a class", "input": { "className": "Simple or fully qualified class name", "projectPath": "optional, for project-aware search" } } ``` **Example queries:** - `find_class("Ref")` → Multiple matches, ranked by likelihood - `find_class("cats.effect.Ref")` → Exact match - `find_class("IO")` → Shows cats-effect.IO, zio.IO, etc. **Returns:** ```json { "matches": [ { "className": "cats.effect.kernel.Ref", "coordinates": "org.typelevel::cats-effect:3.5.4", "inProject": true, "confidence": "high" }, { "className": "zio.Ref", "coordinates": "dev.zio::zio:2.1.0", "inProject": false, "confidence": "medium" } ] } ``` ## Dependencies - Requires #12 (build tool integration) for project-aware search - Can work standalone with explicit coordinates ## Implementation Options 1. **Index project deps only**: Fast, limited scope 2. **Index + Maven Central search**: Broader but slower 3. **Pre-built index of common libraries**: Good balance ## Value for Agent - Eliminates "which artifact?" guessing - Can directly proceed to `get_documentation` with correct coordinates - Understands if a class is from project deps or external ## Acceptance Criteria - [ ] Find class by simple name within project dependencies - [ ] Find class by fully qualified name - [ ] Rank results (project deps first, then by popularity) - [ ] Return coordinates ready for `get_documentation`
Sign in to join this conversation.
No description provided.