AgentSkillsCN

api-fetcher

安全地从REST/GraphQL API获取数据。

SKILL.md
--- frontmatter
name: api-fetcher
description: Fetch data from REST/GraphQL APIs securely.
status: implemented

Api Fetcher

Fetch data from REST/GraphQL APIs securely.

Usage

node api-fetcher/scripts/fetch.cjs [options]

Options

FlagAliasTypeRequiredDescription
--url-ustringYesTarget URL
--method-mstringNoHTTP method (default: GET)
--headers-HstringNoJSON string of request headers
--body-bstringNoJSON string of request body
--out-ostringNoOutput file path

Troubleshooting

ErrorCauseFix
Invalid headers: Unexpected tokenMalformed JSON in --headersEnsure valid JSON: --headers '{"Authorization":"Bearer token"}'
Invalid request body: Unexpected tokenMalformed JSON in --bodyValidate JSON before passing
ECONNREFUSEDTarget server is down or unreachableCheck URL and network connectivity
ETIMEDOUTRequest timed outVerify server availability, check firewall rules
ENOTFOUNDDNS resolution failedCheck URL spelling, verify DNS settings
Request failed with status code 4xx/5xxServer returned an errorCheck authentication, request format, API docs

Knowledge Protocol

  • This skill adheres to the knowledge/orchestration/knowledge-protocol.md. It automatically integrates Public, Confidential (Company/Client), and Personal knowledge tiers, prioritizing the most specific secrets while ensuring no leaks to public outputs.