Skip to main content
Glama

davinci_api_index

Scans DaVinci installation JARs to create a cached, read-only Java API index for querying classes, methods, and fields offline.

Instructions

扫描 DaVinci 安装目录的 JAR,建一份本机 Java API 索引(只读)。

这是「查真实 API」的那一步:直接解析 class 文件里的类、方法、字段、泛型签名, 不需要 JDK,也不需要联网。结果按 JAR 的大小+mtime 缓存,重复调用命中缓存。

Args: home: DaVinci 安装根(其中应有 plugins 目录)。留空时依次尝试 DAVINCI_HOME / DAVINCI_CFG6_HOME / DAVINCI_CFG5_HOME / DAVINCI_CFG5_SIP, 或从已发现的 dvcfg-b / DVCfgCmd 向上找 plugins。 jars: 直接指定 JAR 路径列表,覆盖 home 的自动发现(排查时有用)。 rebuild: 忽略缓存重建索引;升级 DaVinci 或换了 BSW 包后用。 full: 扫安装目录下全部 JAR,而不是只扫名字含 automation/api/groovy/model 的。 include_private: 连 private 成员一起索引(默认只收 public/protected)。 package_prefix: 只保留该包前缀下的类,默认 com.vector;传空字符串索引全部。 limit: 包概览与入口类型的返回条数。

索引建好后,用 davinci_script_api(source="jar", ...) 查询。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "davinci_api_index"
  }
}

Input Schema

NameRequiredDescriptionDefault
fullNo
homeNo
jarsNo
limitNo
rebuildNo
package_prefixNocom.vector
include_privateNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.13.0

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full burden and does so well: it declares the operation read-only, that it parses class files directly, that no JDK or network is needed, and that results are cached keyed by JAR size+mtime so repeat calls hit the cache. The gaps are minor – it doesn't say roughly how long a cold rebuild takes, or where the cache is persisted on disk (a write side effect of an otherwise read-only tool).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core purpose is front-loaded in the first line, a short second paragraph explains the mechanism and caching, and the Args block is a scannable per-parameter list. For a 7-parameter tool this length is justified and there is no filler prose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 7 optional parameters, no annotations and no output schema, the definition supplies what an agent needs to invoke it correctly: discovery fallbacks, cache behavior, and the follow-up query tool. The return shape is only hinted at through limit's mention of package overview and entry types, which is the one area an agent might still guess at.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 7 parameters, so the description must compensate, and the Args block covers every one: home's fallback chain, jars overriding discovery, rebuild invalidating cache, full broadening the JAR set beyond the name-based automation/api/groovy/model filter, include_private vs the public/protected default, package_prefix defaulting to com.vector with empty-string meaning all, and limit controlling package overview and entry-type counts. That is meaning well beyond bare types and defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line states a specific verb and resource: scan the JARs in the DaVinci install directory and build a local Java API index, read-only. It also distinguishes this step from the sibling it hands off to, naming davinci_script_api(source="jar", ...) as the query side, so an agent can tell indexing apart from querying without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete usage contexts: set rebuild after upgrading DaVinci or swapping BSW packages, set jars when troubleshooting to override auto-discovery, and leave home blank to fall back through DAVINCI_HOME/DAVINCI_CFG6_HOME/CFG5 variants. It also states the downstream step explicitly: after the index is built, query with davinci_script_api, which is clear when-to-use routing rather than an implied purpose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.