Bỏ qua tới nội dung
TakoAPI
Quay lại kỹ năng

markdown-fetch

bởi howtimeschange

Web & Frontend Development
1.6kLượt tải do clawskills.sh công bố
1Sao
0Lượt xem
0 lượt thíchĐăng nhập để thích kỹ năng này
—Chưa có đánh giá
Đánh giá của bạn

Tóm tắt

Optimizes web fetching by using Cloudflare's Markdown for Agents, reducing token consumption by ~80%.

Mô tả

Kỹ năng này làm gì

Wraps web fetch calls to request Cloudflare's Markdown for Agents format, returning markdown instead of HTML when the server supports it. Tracks token savings via the x-markdown-tokens response header. Falls back to HTML for sites that don't support the format.

Reduces token consumption by ~80% on supported sites compared to fetching raw HTML, which directly lowers API costs and fits more content into context windows.

Khi nào nên dùng

  • Fetching documentation pages with reduced token overhead
  • Scraping Cloudflare-hosted sites in agent pipelines
  • Replacing axios/fetch calls project-wide with a drop-in optimized version
  • Logging token savings across multiple web requests
  • Reading web content in LLM context windows more efficiently

Quy trình ví dụ

ĐẦU VÀO

User asks: fetch the content of https://example.com and summarize it

AGENT
  1. 1

    Call optimizedFetch with the target URL

  2. 2

    Set Accept header to 'text/markdown, text/html'

  3. 3

    Check response Content-Type to determine format

  4. 4

    If text/markdown, use result.markdown directly; otherwise fall back to result.html

  5. 5

    Log token savings from x-markdown-tokens header if present

ĐẦU RA

Markdown content of the page with tokensSaved value reported

Cài đặt

clawhub install howtimeschange/markdown-fetch

Chạy lệnh CLI, hoặc dán prompt vào Claude Code, Cursor, Codex hay coding agent bạn đang dùng.

Liên kết