Ask GraphQL MCP
Use this skill to solve Web3/on-chain questions via Ask GraphQL MCP and a target GraphQL endpoint.
Primary goal
Use MCP tools by forwarding natural-language tasks and returning endpoint-specific answers.
Do not use direct GraphQL calls as default behavior. Use MCP first.
Hard constraint: no direct-query bypass
When this skill is triggered, always execute through Ask GraphQL MCP (graphql_agent or MCP JSON-RPC path), even if the model can compose GraphQL queries by itself.
Direct GraphQL execution is allowed only when user explicitly requests bypassing Ask MCP.
Required inputs
Collect these inputs before analysis:
- - User question or task (required)
- GraphQL endpoint URL (required for execution; can be discovered via
graphql-endpoint-discovery) - Plan mode: default
free; switch to paid only when free-tier limit is reached or user explicitly asks - API key (required for paid mode)
- Optional
X-ENDPOINT-AUTHORIZATION when upstream endpoint is private
When endpoint URL is missing:
- 1. Run pre-skill INLINECODE5
- If high-confidence endpoint candidate exists, continue automatically
- If ambiguous, ask user to confirm among top candidates
- If no candidate, ask user for endpoint directly
Deterministic invocation rules
Use this exact routing logic:
- 1. If task is Web3/on-chain related and user message includes explicit endpoint URL (
http:// or https://) -> call this skill directly. - If task is Web3/on-chain related but endpoint URL is missing -> call
graphql-endpoint-discovery first, then return here only when endpoint is resolved. - If task is clearly non-Web3 and non-on-chain -> do not call this skill.
- In one user turn, at most one execution path is allowed:
- - direct
ask-graphql-mcp, or - INLINECODE10 then INLINECODE11
Never ask user for endpoint before running graphql-endpoint-discovery once.
Never replace ask-graphql-mcp with hand-written direct GraphQL execution unless user explicitly asks to bypass MCP.
MCP connection policy
- 1. Default to free gateway: INLINECODE14
- Use paid gateway only when needed: INLINECODE15
- Always set
X-ENDPOINT to the user endpoint - Set
X-ENDPOINT-AUTHORIZATION only when upstream endpoint requires auth - In paid mode, include INLINECODE18
Use templates from references/config-templates.md when you need to emit copy-ready JSON.
Agent execution workflow
- 1. Confirm endpoint and user objective. If endpoint is missing, run
graphql-endpoint-discovery first. - Prefer session tool path: if
graphql_agent is available in current session tool list, use it. - If session tool is unavailable, use HTTP JSON-RPC path to Ask MCP gateway with required headers (
X-ENDPOINT, optional X-ENDPOINT-AUTHORIZATION, and X-API-KEY in paid mode). - Send the user task to MCP in natural language.
- Timeout policy: when question complexity is high, allow MCP/agent call timeout up to 2 minutes (120s) before treating it as failed.
- If needed, send one follow-up clarification prompt to MCP.
- Return MCP result with concise interpretation for the user.
HTTP JSON-RPC path (when session tool is unavailable)
Use MCP gateway endpoint:
- - Free: INLINECODE25
- Paid: INLINECODE26
Call sequence:
- 1.
tools/list to verify graphql_agent is exposed by gateway - INLINECODE29 with:
- - INLINECODE30
- INLINECODE31
This path still uses MCP, not direct GraphQL querying.
Fallback workflow
If the task fails:
- 1. Validate gateway URL matches current mode (free/paid).
- Validate
X-ENDPOINT format and reachability. - Validate
X-ENDPOINT-AUTHORIZATION for private endpoints. - Validate
X-API-KEY in paid mode. - Retry with minimal known-good config.
If MCP returns free-tier rate limit/quota errors:
- - Guide user to create API key at INLINECODE35
- Switch user to paid gateway
https://ask-api.hermes-subnet.ai/mcp with INLINECODE37 - Explicitly ask user to provide API key now so execution can continue immediately
- Provide a copy-ready paid config snippet with
X-API-KEY placeholder in the same response - Do not end with only "retry later" or "wait for reset"; API key request must come first
If paid API key quota is exceeded:
- - Guide user to check usage/quota at INLINECODE39
Response standard
For endpoint analysis requests, structure responses as:
- 1. Assumptions
- MCP answer summary
- Optional query/details provided by MCP
- Next step (run/verify/debug)
For pure setup requests, provide one copy-ready JSON block plus a short verification checklist.
When mentioning quota/rate-limit failures, always include the correct billing link:
- - API key creation: INLINECODE40
- Usage/quota check: INLINECODE41
For free-tier limit errors, treat API key guidance as highest-priority next action:
- - First line should clearly request API key from user
- Include API key creation link in the same message
- Include paid-mode gateway and required header keys
Rate-limit detection and mandatory wording
Treat these as free-tier limit signals:
- - INLINECODE42
- INLINECODE43
- INLINECODE44
- INLINECODE45
- INLINECODE46
When any signal appears, reply with this mandatory first sentence pattern:
Then include:
- 1. Paid gateway URL: INLINECODE48
- Required paid header: INLINECODE49
- If relevant, quota page: INLINECODE50
For practical prompt patterns, read references/tools-and-prompts.md.
Ask GraphQL MCP
使用此技能通过 Ask GraphQL MCP 和目标 GraphQL 端点解决 Web3/链上问题。
主要目标
通过转发自然语言任务并返回端点特定答案来使用 MCP 工具。
默认行为不要直接使用 GraphQL 调用。优先使用 MCP。
硬性约束:禁止直接查询绕过
当此技能被触发时,始终通过 Ask GraphQL MCP(graphql_agent 或 MCP JSON-RPC 路径)执行,即使模型本身可以编写 GraphQL 查询。
仅当用户明确要求绕过 Ask MCP 时,才允许直接执行 GraphQL。
必需输入
在分析前收集以下输入:
- - 用户问题或任务(必需)
- GraphQL 端点 URL(执行必需;可通过 graphql-endpoint-discovery 发现)
- 计划模式:默认为 free;仅在免费层配额用尽或用户明确要求时切换到 paid
- API 密钥(付费模式必需)
- 上游端点为私有时,可选的 X-ENDPOINT-AUTHORIZATION
当缺少端点 URL 时:
- 1. 运行技能前 graphql-endpoint-discovery
- 如果存在高置信度端点候选,自动继续
- 如果存在歧义,请用户在候选列表中确认
- 如果没有候选,直接询问用户端点
确定性调用规则
使用以下精确路由逻辑:
- 1. 如果任务与 Web3/链上相关且用户消息包含显式端点 URL(http:// 或 https://)-> 直接调用此技能。
- 如果任务与 Web3/链上相关但缺少端点 URL -> 先调用 graphql-endpoint-discovery,仅在端点解析后返回此处。
- 如果任务明显非 Web3 且非链上 -> 不调用此技能。
- 在单次用户交互中,最多允许一条执行路径:
- - 直接 ask-graphql-mcp,或
- graphql-endpoint-discovery 然后 ask-graphql-mcp
在运行 graphql-endpoint-discovery 之前,绝不询问用户端点。
除非用户明确要求绕过 MCP,否则绝不使用手写直接 GraphQL 执行替代 ask-graphql-mcp。
MCP 连接策略
- 1. 默认使用免费网关:https://ask-api.hermes-subnet.ai/mcp/graphql-agent
- 仅在需要时使用付费网关:https://ask-api.hermes-subnet.ai/mcp
- 始终将 X-ENDPOINT 设置为用户端点
- 仅在上游端点需要认证时设置 X-ENDPOINT-AUTHORIZATION
- 在付费模式下,包含 X-API-KEY
当需要输出可直接复制的 JSON 时,使用 references/config-templates.md 中的模板。
代理执行工作流
- 1. 确认端点和用户目标。如果缺少端点,先运行 graphql-endpoint-discovery。
- 优先使用会话工具路径:如果当前会话工具列表中存在 graphql_agent,则使用它。
- 如果会话工具不可用,使用 HTTP JSON-RPC 路径连接到 Ask MCP 网关,并携带必需头部(X-ENDPOINT、可选的 X-ENDPOINT-AUTHORIZATION,以及付费模式下的 X-API-KEY)。
- 以自然语言将用户任务发送给 MCP。
- 超时策略:当问题复杂度较高时,允许 MCP/代理调用超时时间最长 2 分钟(120 秒),之后视为失败。
- 如果需要,向 MCP 发送一次后续澄清提示。
- 返回 MCP 结果并为用户提供简洁解释。
HTTP JSON-RPC 路径(当会话工具不可用时)
使用 MCP 网关端点:
- - 免费:https://ask-api.hermes-subnet.ai/mcp/graphql-agent
- 付费:https://ask-api.hermes-subnet.ai/mcp
调用顺序:
- 1. tools/list 验证网关暴露了 graphql_agent
- tools/call 使用:
- - name: graphql_agent
- arguments.question: <用户自然语言请求>
此路径仍使用 MCP,而非直接 GraphQL 查询。
回退工作流
如果任务失败:
- 1. 验证网关 URL 与当前模式(免费/付费)匹配。
- 验证 X-ENDPOINT 格式和可达性。
- 验证私有端点的 X-ENDPOINT-AUTHORIZATION。
- 验证付费模式下的 X-API-KEY。
- 使用已知的最小正确配置重试。
如果 MCP 返回免费层速率限制/配额错误:
- - 引导用户在 https://ask.hermes-subnet.ai/billing/api-keys/ 创建 API 密钥
- 将用户切换到付费网关 https://ask-api.hermes-subnet.ai/mcp 并携带 X-API-KEY
- 明确要求用户立即提供 API 密钥以便继续执行
- 在同一响应中提供带有 X-API-KEY 占位符的可直接复制付费配置片段
- 不要仅以稍后重试或等待重置结束;API 密钥请求必须优先
如果付费 API 密钥配额用尽:
- - 引导用户在 https://ask.hermes-subnet.ai/billing/ 检查使用情况/配额
响应标准
对于端点分析请求,响应结构为:
- 1. 假设
- MCP 答案摘要
- MCP 提供的可选查询/详情
- 下一步(运行/验证/调试)
对于纯设置请求,提供一个可直接复制的 JSON 块加上简短验证清单。
当提及配额/速率限制失败时,始终包含正确的计费链接:
- - API 密钥创建:https://ask.hermes-subnet.ai/billing/api-keys/
- 使用情况/配额检查:https://ask.hermes-subnet.ai/billing/
对于免费层限制错误,将 API 密钥引导作为最高优先级的下一个操作:
- - 第一行应明确要求用户提供 API 密钥
- 在同一消息中包含 API 密钥创建链接
- 包含付费模式网关和必需的头部键
速率限制检测和强制措辞
将以下情况视为免费层限制信号:
- - rate limit exceeded
- quota exceeded
- too many requests
- retryAfter
- 429
当出现任何信号时,使用以下强制首句模式回复:
- - 免费配额已用尽。请在 https://ask.hermes-subnet.ai/billing/api-keys/ 创建 API 密钥并将其发送给我,以便我立即继续。
然后包含:
- 1. 付费网关 URL:https://ask-api.hermes-subnet.ai/mcp
- 必需的付费头部:X-API-KEY
- 如果相关,配额页面:https://ask.hermes-subnet.ai/billing/
关于实用提示模式,请阅读 references/tools-and-prompts.md。