Skip to main content
Glama
Timwal78

ScriptDocs MCP Server

Search Package Docs

docs_search_docs
Read-onlyIdempotent

Search a package's real README or docs for keywords and retrieve verbatim matching snippets with surrounding context, source URL, and line hints.

Instructions

Search for keywords inside a package's real README/docs and return verbatim matching snippets with surrounding context.

This does keyword matching over the actual fetched document (registry README for npm, long description for PyPI, README-derived text for Cargo) — it does not summarize or paraphrase, and it does not answer from general knowledge. If no matches are found, it says so rather than guessing at an answer.

Args:

  • ecosystem ('npm' | 'pypi' | 'cargo')

  • package_name (string): exact package name

  • query (string): keyword(s) to search for, e.g. "rate limit" or "async client"

  • max_snippets (number, 1-20, default 5): cap on returned matches

  • version (string, optional): specific version to search; defaults to latest

Returns JSON with: snippets (array of {match, context, line_hint}), source_url, fetched_at.

Error Handling:

  • Returns "Error: ..." if the package/docs can't be fetched

  • Returns an empty snippets array (not an error) if the docs were fetched successfully but the query has no matches

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesKeyword(s) to search for inside the package's real documentation, e.g. 'authentication middleware'.
versionNoSpecific version to search within. Defaults to the latest published version if omitted.
ecosystemYesWhich package registry to query: 'npm', 'pypi', or 'cargo'.
max_snippetsNoMaximum number of matching snippets to return.
package_nameYesExact package name as published on the registry.
Behavior5/5

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

Beyond annotations (readOnly, idempotent, openWorld), the description adds meaningful behavioral details: it matches keywords over actual fetched docs, does not summarize/paraphrase, returns empty array on no matches, and returns an error if the package/docs cannot be fetched. This gives the agent a clear model of what to expect.

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

Conciseness4/5

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

The description is well-structured with bolded section headers and front-loaded purpose, but the Args list largely duplicates the input schema, making it slightly longer than necessary. It remains clear and every non-Args sentence carries important behavioral context.

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

Completeness5/5

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

With no output schema, the description fully specifies the return JSON structure (snippets array with match/context/line_hint, source_url, fetched_at) and error handling (error string vs empty array). It covers all five parameters' semantics via schema plus the tool's overall behavior, making it complete for an AI agent.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description's Args section repeats schema information (exact name, max cap, default version) without adding new parameter-level semantics; the main added value is return-format and error-handling context rather than richer parameter meaning.

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 description opens with a specific verb+resource: 'Search for keywords inside a package's real README/docs' and immediately distinguishes itself by promising 'verbatim matching snippets with surrounding context' and explicitly ruling out summarization or general knowledge. This clearly differentiates it from sibling tools like docs_get_readme or docs_resolve_library.

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

Usage Guidelines4/5

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

The description establishes clear context for when the tool is appropriate: keyword matching over real fetched documents, with a note that it does not summarize or answer from general knowledge. However, it does not explicitly name alternative tools or state when not to use it, so it stops short of the 'explicit when/when-not' standard.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Timwal78/scriptdocs-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server