跳到正文
TakoAPI
返回技能列表

markdown-fetch

由 howtimeschange 提供

Web & Frontend Development
1.6k下载量由 clawskills.sh 提供
1星标
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

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

描述

该技能的功能

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.

何时使用

  • 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

示例工作流

输入

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

智能体
  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

输出

Markdown content of the page with tokensSaved value reported

安装

clawhub install howtimeschange/markdown-fetch

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接