Skip to main content
Glama
sisilet

Wayback Machine MCP Server

by sisilet

search_items

Search Internet Archive items using advanced filters for media type, collection, fields, sorting, and pagination to find specific archived content.

Instructions

Search Internet Archive items using Advanced Search (archive.org). Supports basic query, optional mediatype/collection filters, fields, sort, rows, and page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionNo
fieldsNo
mediatypeNo
pageNo
queryYes
rowsNo
sortNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'search_items' tool. It constructs a search query for archive.org's advanced search API, applies filters for mediatype and collection, sets default fields and sorting, fetches JSON results, and returns structured response with numFound and docs.
    async def search_items(
    	query: str,
    	mediatype: Optional[str] = None,
    	collection: Optional[str] = None,
    	fields: Optional[List[str]] = None,
    	sort: Optional[List[str]] = None,
    	rows: int = 50,
    	page: int = 1,
    ) -> Dict[str, Any]:
    	"""
    	Search archive.org items. Returns total, page info, and docs.
    	- query: Lucene-like search string
    	- mediatype: optional filter (e.g., texts, movies, audio, software, image)
    	- collection: optional collection filter (e.g., web)
    	- fields: list of field names to include (defaults to common ones)
    	- sort: list like ["downloads desc", "publicdate desc"]
    	"""
    	q = query.strip() if query else "*:*"
    	if mediatype:
    		q += f" AND mediatype:{mediatype}"
    	if collection:
    		q += f" AND collection:{collection}"
    
    	default_fields = [
    		"identifier",
    		"title",
    		"mediatype",
    		"publicdate",
    		"downloads",
    	]
    	fl = fields if fields else default_fields
    
    	default_sort = ["downloads desc"]
    	srt = sort if sort else default_sort
    
    	params: Dict[str, Any] = {
    		"q": q,
    		"fl[]": fl,
    		"sort[]": srt,
    		"rows": rows,
    		"page": page,
    		"output": "json",
    	}
    
    	data = await _fetch_json(ADVANCED_SEARCH_ENDPOINT, params)
    	response = data.get("response", {}) if isinstance(data, dict) else {}
    	return {
    		"q": q,
    		"rows": rows,
    		"page": page,
    		"numFound": response.get("numFound", 0),
    		"docs": response.get("docs", []),
    	}
  • Registers the 'search_items' tool with the FastMCP app using the @app.tool decorator, specifying the name and description.
    @app.tool(
    	name="search_items",
    	description=(
    		"Search Internet Archive items using Advanced Search (archive.org). "
    		"Supports basic query, optional mediatype/collection filters, fields, sort, rows, and page."
    	),
    )
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool 'supports basic query, optional mediatype/collection filters, fields, sort, rows, and page,' which hints at search capabilities but lacks details on permissions, rate limits, pagination behavior, or response format. For a search tool with 7 parameters and no annotation coverage, this leaves significant gaps in understanding how the tool behaves beyond basic functionality.

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 a single, efficient sentence that front-loads the main purpose ('Search Internet Archive items using Advanced Search') and follows with key features. It avoids redundancy and wastes no words, making it appropriately sized for the tool's complexity. A point is deducted as it could be slightly more structured, but overall it's concise and clear.

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

Completeness3/5

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

Given the tool has 7 parameters, no annotations, and an output schema exists (which reduces the need to explain return values), the description is minimally adequate. It covers the basic purpose and hints at parameters, but lacks details on usage guidelines, behavioral traits, and parameter semantics. For a search tool with moderate complexity, this leaves room for improvement, scoring at the minimum viable level.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It lists parameters like 'basic query, optional mediatype/collection filters, fields, sort, rows, and page,' which adds some meaning beyond the schema's property names, but doesn't explain what each parameter does, acceptable values, or how they interact. With 7 parameters and low coverage, this partial compensation is insufficient, scoring below the baseline.

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

Purpose4/5

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

The description clearly states the tool searches Internet Archive items using Advanced Search, specifying the target resource and verb. It distinguishes from siblings like get_archived_page and get_snapshots by focusing on search functionality rather than retrieving specific pages or snapshots. However, it doesn't explicitly contrast with siblings, keeping it at 4 instead of 5.

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

Usage Guidelines2/5

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

The description mentions 'supports basic query, optional mediatype/collection filters, fields, sort, rows, and page,' which implies usage for searching with various filters, but provides no explicit guidance on when to use this tool versus alternatives like get_archived_page or get_snapshots. There's no mention of prerequisites, exclusions, or comparative contexts, resulting in minimal guidance.

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/sisilet/wayback-mcp'

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