library-api-research
Verify crate/library APIs from docs, not memory.
- License 许可
- MIT
- 最近更新
- 2026-10-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- library-api-research
- author
- Hermes Agent
- license
- MIT
- version
- 1.0.0
- metadata
- { "hermes": { "tags": [ "rust", "api", "context7", "mcp", "research", "verification" ] } }
- platforms
- [ "linux", "macos", "windows" ]
- description
- Verify crate/library APIs from docs, not memory.
03 SKILL.md 正文
Library API Research — verify, don't guess
Trigger: You are about to write or fix code that calls a third-party library (crate, npm package, Python SDK) and you are not 100% certain of an exact signature, module path, struct field, trait name, or feature flag. Stop and verify — do NOT recall it from memory.
User correction this encodes: "did you use mcp-cli for context 7 mcp so you dont gues functions" — guessing library APIs produced 10+ compile errors in one Rust session. Verifying first avoids the whole loop.
Method A — Context7 via mcp-cli (preferred when connected)
Context7 is an MCP server that returns version-pinned library docs. Invoke it with mcp-cli.
- Resolve the canonical library id (fuzzy name → id):
echo '{"libraryName":"grammers","query":"telegram mtproto client rust"}' \ | mcp-cli call context7/resolve-library-id # -> /lonami/grammers - Pull docs for the exact symbols you need:
echo '{"libraryId":"/lonami/grammers","query":"resolve_peer PeerRef iter_messages self_user saved messages","tokens":6000}' \ | mcp-cli call context7/query-docs
Traps:
- The docs tool is
query-docs.get-library-docsdoes NOT exist (TOOL_NOT_FOUND). Onlyresolve-library-idandquery-docsexist. - Broken npx cache: if
mcp-cli call context7/...fails withERR_MODULE_NOT_FOUND ... @modelcontextprotocol/server/mcp-remote, clear the stale npx cache:rm -rf ~/.npm/_npx/<hash>(hash from the error path), thenmcp-cli info context7. - Pipe-to-interpreter may be blocked; write JSON to a temp file then parse, or use
echo '...' | mcp-cli call ... -where stdin mode is supported.
Method B — read crate source from the cargo registry cache (always available offline)
For Rust, the authoritative source is already on disk after any cargo build/cargo fetch:
~/.cargo/registry/src/<index-hash>/<crate>-<version>/
Grep for the real symbol rather than guessing:
rmcp::Server? — grep shows there is NOServerstruct; serve viarmcp::service::serve_serverorServerHandlerimpl +ServiceExt::serve, transportrmcp::transport::stdio()(gated behindtransport-iofeature).grammers_client::types::Dialog? — grep:Dialogis atgrammers_client::peer::Dialog;PeerRefis atgrammers_session::types::PeerRef;iter_messagestakes aPeerRef.Tool/Content/CallToolResultconstructors — readrmcp/src/model/tool.rs,content.rsto get exact fields (e.g.Tool { name, description, input_schema: Arc<JsonObject> },Content::text(String),CallToolResult::success(Vec<Content>)).
When to use which
- Context7 connected → Method A (cleanest, version-aware, no local path soup).
- Context7 absent → Method B (registry source is equally authoritative and faster than guessing).
- Either way: after the compile, run
cargo check(not fullcargo build) for fast error iteration — see therust-cargo-buildskill.
Pair with
rust-cargo-build(cargo check fast loop, rmcp/grammers API notes, crates.io publish prep).
04 同仓库更多 Skills
blocked-page-recovery
Use when a fetch fails: 403/429, paywall, WAF, bot wall.
gemini-vision-fallback
Vision fallback: Gemini REST API if vision_analyze blocked.
twitter-cli
Use twitter-cli for ALL Twitter/X operations — reading tweets, posting, replying, quoting, liking, retweeting, following, searching, user lookups. Invoke whenever user requests any Twitter interaction.
prism-scan
Structural analysis through dynamically generated cognitive lenses. Generates the optimal analytical lens for the specific code/artifact, then executes it. Finds conservation laws, structural invariants, and concrete bugs that vanilla analysis misses. Use on any code file, system design, or text artifact.
prism-reflect
Constraint transparency: analyzes an artifact structurally, then analyzes what its own analysis concealed. Produces a conservation law AND a constraint report showing what was maximized, what was sacrificed, and what to investigate next. The only AI skill that knows what it can't see.
prism-full
Full Prism: multi-pass structural analysis with mandatory adversarial self-correction. Designs custom analytical passes, executes them with chaining, then attacks its own findings before synthesizing. Use for maximum depth on important code or artifacts.