open_page

GitHub

通过文档ID获取完整未截断的文档内容,解决local_search返回片段不完整的问题,确保获取关键信息。

skills/tools/mask/open_page/SKILL.md zzatpku/AgentFactory

Trigger Scenarios

需要获取文档完整内容时 local_search结果被截断需补充全文时

Install

npx skills add zzatpku/AgentFactory --skill open_page -g -y
More Options

Non-standard path

npx skills add https://github.com/zzatpku/AgentFactory/tree/master/skills/tools/mask/open_page -g -y

Use without installing

npx skills use zzatpku/AgentFactory@open_page

指定 Agent (Claude Code)

npx skills add zzatpku/AgentFactory --skill open_page -a claude-code -g -y

安装 repo 全部 skill

npx skills add zzatpku/AgentFactory --all -g -y

预览 repo 内 skill

npx skills add zzatpku/AgentFactory --list

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_page for relevant search results - the text from local_search is truncated and may miss critical information

Version History

  • df92287 Current 2026-07-25 08:38

Same Skill Collection

skills/meta/create_subagent/SKILL.md
skills/meta/finish/SKILL.md
skills/meta/list_saved_subagents/SKILL.md
skills/meta/modify_subagent/SKILL.md
skills/meta/run_subagent/SKILL.md
skills/meta/view_subagent_code/SKILL.md
skills/tools/google_search/SKILL.md
skills/tools/jina_reader/SKILL.md
skills/tools/mask/local_search/SKILL.md
skills/tools/playwright/SKILL.md
skills/tools/shell_command/SKILL.md

Metadata

Files
0
Version
df92287
Hash
605a5dc3
Indexed
2026-07-25 08:38

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-21 04:15
浙ICP备14020137号-1 $mapa de visitantes$