Agent Skills
› zzatpku/AgentFactory
› open_page
open_page
GitHub通过文档ID获取完整未截断的文档内容,解决local_search返回片段不完整的问题,确保获取关键信息。
Trigger Scenarios
需要获取文档完整内容时
local_search结果被截断需补充全文时
Install
npx skills add zzatpku/AgentFactory --skill open_page -g -y
SKILL.md
Frontmatter
{
"name": "open_page",
"description": "Retrieve the full content of a document by its ID. The text from local_search is incomplete\/truncated - always use open_page to get the full document content for relevant results."
}
Open Page Tool
Retrieve the full, untruncated content of a document using its document ID. Since local_search only returns incomplete snippets that may cut off at arbitrary points, use open_page on any relevant result to ensure you have the complete information.
Usage
from tools import open_page
content = open_page(docid)
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| docid | str | required | The document ID obtained from local_search results |
Returns
{
"results": [
{
"docid": "document_id_string",
"url": "https://example.com/page",
"text": "full document content..."
}
],
"took_ms": 12.5
}
Or on error:
{"error": "error message"}
Note: The text is inside results[0]["text"], not at the top level.
Example
from tools import local_search, open_page
# First search for documents
results = local_search("machine learning basics", topk=3)
# Get the docid of the most relevant result
if results.get("results"):
top_doc = results["results"][0]
docid = top_doc["docid"]
# Open the full document
full_content = open_page(docid)
if "error" not in full_content and full_content.get("results"):
doc = full_content["results"][0]
print(f"DocID: {doc.get('docid', 'N/A')}")
print(f"Content: {doc.get('text', '')[:1000]}...")
Tips
- Always use docids from local_search results, don't guess document IDs
- Check for errors in the response before processing
- Full documents can be long; extract relevant sections for analysis
- Always call
open_pagefor relevant search results - the text fromlocal_searchis truncated and may miss critical information
Version History
- df92287 Current 2026-07-25 08:38


