pipefy-introspection
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseIntrospection & Raw GraphQL
内省与原始GraphQL
Schema discovery, organization info, and a fallback executor. 7 MCP tools.
This is Tier 2 in the resolution strategy: when a dedicated MCP tool fails or doesn't exist, use introspection to understand the API, then to run the operation directly.
execute_graphqlTier 1: dedicated MCP tool exists — use it.
Tier 2: use introspection + (this skill).
Tier 3: direct curl/httpx fallback — see skills/api-troubleshoot/pipefy-api-fallback/SKILL.md.
execute_graphql用于Schema探索、组织信息查询,以及作为备用执行器。包含7个MCP工具。
这是解决方案策略中的Tier 2:当专用MCP工具执行失败或不存在对应操作工具时,使用内省功能了解API,然后通过直接运行操作。
execute_graphqlTier 1: 存在专用MCP工具 —— 使用该工具。
Tier 2: 使用内省 + (即本技能)。
Tier 3: 直接使用curl/httpx作为备用方案 —— 详见skills/api-troubleshoot/pipefy-api-fallback/SKILL.md。
execute_graphqlTools
工具
| Tool (MCP) | CLI | Read-only | Purpose |
|---|---|---|---|
| | Yes | Type shape: |
| | Yes | Root query arguments and return type. Optional |
| | Yes | Root mutation arguments and return type. Optional |
| | Yes | Keyword search on type names/descriptions. Optional |
| | No | Execute arbitrary GraphQL ( |
| | Yes | Load organization info (name, plan, UUID, member count, pipe count). |
| | Yes | List organizations the caller can access — no id required. The zero-knowledge entry point for org discovery. |
| 工具(MCP) | CLI命令 | 只读 | 用途 |
|---|---|---|---|
| | 是 | 查看类型结构: |
| | 是 | 查看根查询的参数和返回类型。可选参数 |
| | 是 | 查看根mutation的参数和返回类型。可选参数 |
| | 是 | 按关键词搜索类型名称/描述。可选参数 |
| | 否 | 执行任意GraphQL操作(执行mutation需添加 |
| | 是 | 加载组织信息(名称、套餐、UUID、成员数量、管道数量)。 |
| | 是 | 列出调用者可访问的所有组织 —— 无需ID。这是组织探索的零知识入口。 |
The include_parsed
flag
include_parsedinclude_parsed
标志
include_parsedexecute_graphqlintrospect_typeintrospect_mutationintrospect_queryget_organizationinclude_parsed: boolfalse- Default (): response is
falsewhere{ success, result }is the raw GraphQL JSON as a string.result - : response includes both
true(the raw JSON string) ANDresult(the parsed dict). Drill intodataprogrammatically; keepdatato forward verbatim.result
Use whenever you plan to read nested fields (e.g. iterating over ). Leave it off for one-shot reads where the raw string is sufficient.
include_parsed=truephases[].fields[]execute_graphqlintrospect_typeintrospect_mutationintrospect_queryget_organizationinclude_parsed: boolfalse- 默认值(): 响应格式为
false,其中{ success, result }是原始GraphQL JSON的字符串形式。result - 设置为: 响应同时包含
true(原始JSON字符串)和result(解析后的字典)。可通过data以编程方式深入访问嵌套字段;保留data可直接转发原始内容。result
当你需要读取嵌套字段时(例如遍历),请设置。如果仅需一次性读取原始字符串内容,则无需开启此参数。
phases[].fields[]include_parsed=truemax_depth
(introspect_type / query / mutation)
max_depthmax_depth
(适用于introspect_type / query / mutation)
max_depthMCP tools accept (default ). CLI: .
max_depth1--max-depth- — type/field info only (no inlined sub-types).
1 - — resolves referenced input/output types inline (
2+), so one call can replace introspecting the mutation then each input type separately.resolvedType
Example (CLI):
bash
pipefy introspect mutation createCard --max-depth 2 --jsonExample (MCP):
introspect_mutation mutation_name="createCard" max_depth=2 include_parsed=trueScalars (, , , …) are never expanded.
IDStringIntMCP工具支持参数(默认值为1)。CLI中使用。
max_depth--max-depth- —— 仅返回类型/字段信息(不内联子类型)。
1 - —— 内联解析引用的输入/输出类型(
2+),因此一次调用即可替代先内省mutation再分别内省每个输入类型的操作。resolvedType
示例(CLI):
bash
pipefy introspect mutation createCard --max-depth 2 --json示例(MCP):
introspect_mutation mutation_name="createCard" max_depth=2 include_parsed=true标量类型(、、等)永远不会被展开。
IDStringIntkind
on search_schema
kindsearch_schemasearch_schema
中的kind
参数
search_schemakindOptional filter: , , , , , .
OBJECTINPUT_OBJECTENUMSCALARINTERFACEUNIONsearch_schema keyword="automation" kind="INPUT_OBJECT"bash
pipefy introspect schema search automation --kind INPUT_OBJECT --json可选过滤参数:、、、、、。
OBJECTINPUT_OBJECTENUMSCALARINTERFACEUNIONsearch_schema keyword="automation" kind="INPUT_OBJECT"bash
pipefy introspect schema search automation --kind INPUT_OBJECT --jsonWhen to use introspection
何时使用内省功能
- A dedicated tool returned an error and you need to understand why — introspect the input type to check argument names/types.
- Before creating fields: to discover valid
introspect_type('CreatePhaseFieldInput')enum values.type - Before using : introspect the corresponding input type to find optional keys.
extra_input - Unknown mutation signature: before
introspect_mutation('createSomething').execute_graphql - Schema exploration: to find related types and inputs.
search_schema('automation')
- 专用工具返回错误,你需要了解原因 —— 内省输入类型以检查参数名称/类型。
- 创建字段前:调用探索有效的
introspect_type('CreatePhaseFieldInput')枚举值。type - 使用前:内省对应的输入类型以查找可选键。
extra_input - 未知mutation签名:在调用前先执行
execute_graphql。introspect_mutation('createSomething') - Schema探索:调用查找相关类型和输入。
search_schema('automation')
When to use execute_graphql
execute_graphql何时使用execute_graphql
execute_graphql- No dedicated MCP tool exists for the operation.
- A dedicated tool failed and you've used introspection to understand the correct payload.
- Ad-hoc queries like resolving an org UUID via .
pipe(id: $id) { organization { uuid } } - Complex nested queries that no single tool covers.
Always prefer dedicated MCP tools — they validate inputs, handle pagination, and format errors consistently. is the fallback when dedicated tools can't solve the problem.
execute_graphql- 该操作不存在专用MCP工具。
- 专用工具执行失败,且你已通过内省了解正确的请求 payload。
- 临时查询,例如通过解析组织UUID。
pipe(id: $id) { organization { uuid } } - 复杂的嵌套查询,没有单个工具可以覆盖。
优先使用专用MCP工具 —— 它们会验证输入、处理分页,并统一格式化错误信息。只有当专用工具无法解决问题时,才使用作为备用方案。
execute_graphqlSteps — discover a mutation signature
步骤 —— 探索mutation签名
-
Search for the mutation by keyword:
search_schema keyword="label" -
Get the full mutation signature:
introspect_mutation mutation_name="createLabel" -
Discover input type fields:
introspect_type type_name="CreateLabelInput" -
Execute the mutation (CLI):bash
pipefy graphql exec --query "mutation …" --vars '{"input":{…}}' --yes --jsonMutations: the CLI exits with code 2 unlessis passed (guardrail for agents and scripts).--yes -
Execute the mutation (MCP):
execute_graphql query="mutation CreateLabel($input: CreateLabelInput!) { createLabel(input: $input) { label { id name } } }" variables='{"input": {"pipe_id": 67890, "name": "Urgent", "color": "#FF0000"}}'
-
按关键词搜索mutation:
search_schema keyword="label" -
获取完整的mutation签名:
introspect_mutation mutation_name="createLabel" -
探索输入类型的字段:
introspect_type type_name="CreateLabelInput" -
执行mutation(CLI):bash
pipefy graphql exec --query "mutation …" --vars '{"input":{…}}' --yes --json注意: 执行mutation时,CLI会返回退出码2,除非添加参数(这是为Agent和脚本设置的防护机制)。--yes -
执行mutation(MCP):
execute_graphql query="mutation CreateLabel($input: CreateLabelInput!) { createLabel(input: $input) { label { id name } } }" variables='{"input": {"pipe_id": 67890, "name": "Urgent", "color": "#FF0000"}}'
Common fallback recipes
常见备用方案示例
Ready-to-use patterns for situations where dedicated tools are insufficient.
以下是专用工具无法满足需求时的即用型方案。
Recipe 1 — Discover valid field types for create_phase_field
create_phase_field方案1 —— 探索create_phase_field
的有效字段类型
create_phase_fieldintrospect_type('CreatePhaseFieldInput')Look for the field; it references an enum. Introspect the enum to get all valid values.
typeintrospect_type('CreatePhaseFieldInput')找到字段,它引用了一个枚举类型。内省该枚举类型以获取所有有效值。
typeRecipe 2 — Get full behavior config of an AI agent
方案2 —— 获取AI Agent的完整行为配置
get_ai_agentevent_paramsactionParamsactionsAttributesexecute_graphql query='query($uuid: ID!) { aiAgent(uuid: $uuid) { uuid name instruction behaviors { id name active event_id event_params { to_phase_id triggerFieldIds fromPhaseId } action_params { aiBehaviorParams { instruction referencedFieldIds actionsAttributes { name actionType referenceId metadata { destinationPhaseId pipeId fieldsAttributes { fieldId inputMode value } } } } } } } }' variables='{"uuid":"<agent-uuid>"}'get_ai_agentevent_paramsactionParamsactionsAttributesexecute_graphql query='query($uuid: ID!) { aiAgent(uuid: $uuid) { uuid name instruction behaviors { id name active event_id event_params { to_phase_id triggerFieldIds fromPhaseId } action_params { aiBehaviorParams { instruction referencedFieldIds actionsAttributes { name actionType referenceId metadata { destinationPhaseId pipeId fieldsAttributes { fieldId inputMode value } } } } } } } }' variables='{"uuid":"<agent-uuid>"}'Recipe 3 — Find a card by title (not possible with find_cards
)
find_cards方案3 —— 按标题查找卡片(find_cards
无法实现)
find_cardsfind_cardsexecute_graphql query='query($pipeId: ID!, $first: Int) { cards(pipe_id: $pipeId, first: $first) { edges { node { id title current_phase { name } } } } }' variables='{"pipeId":"<pipe-id>","first":50}'Filter by title client-side. For large pipes, paginate with .
afterfind_cardsexecute_graphql query='query($pipeId: ID!, $first: Int) { cards(pipe_id: $pipeId, first: $first) { edges { node { id title current_phase { name } } } } }' variables='{"pipeId":"<pipe-id>","first":50}'在客户端按标题过滤。对于大型管道,使用参数进行分页。
afterRecipe 4 — Discover what extra_input
accepts for any mutation
extra_input方案4 —— 探索任意mutation的extra_input
支持的参数
extra_inputWhen a tool accepts (e.g. , ), discover all optional keys:
extra_inputcreate_automationupdate_labelintrospect_mutation('createAutomation') # find the input type name
introspect_type('CreateAutomationInput') # see all inputFieldsCompare with the tool's primary arguments to know which keys are additive via .
extra_input当某个工具支持时(例如、),探索所有可选键:
extra_inputcreate_automationupdate_labelintrospect_mutation('createAutomation') # 查找输入类型名称
introspect_type('CreateAutomationInput') # 查看所有inputFields将结果与工具的主要参数进行对比,即可知道哪些键可通过添加。
extra_inputRecipe 5 — Discover organization IDs
方案5 —— 探索组织ID
To answer "which organizations do I have access to?" with nothing in hand, call — it needs no id and returns each org's , , , and your role. That is the entry point; reach for the GraphQL fallbacks below only when you already have a pipe.
list_organizationsiduuidnameWhen the user only has a pipe ID and needs its :
organization_idexecute_graphql query='query($id: ID!) { pipe(id: $id) { organization { id uuid name } } }' variables='{"id":"<pipe-id>"}'如果要回答“我可以访问哪些组织?”且没有任何前置信息,调用即可 —— 无需ID,它会返回每个组织的、、以及你的角色。这是入口点;只有当你已经拥有管道ID时,才需要使用下面的GraphQL备用方案。
list_organizationsiduuidname当用户仅拥有管道ID,需要获取对应的时:
organization_idexecute_graphql query='query($id: ID!) { pipe(id: $id) { organization { id uuid name } } }' variables='{"id":"<pipe-id>"}'Recipe 6 — Update a select field's options after creation
方案6 —— 创建后更新选择字段的选项
create_phase_fieldexecute_graphql query='mutation($id: ID!, $options: [String!]) { updatePhaseField(input: { id: $id, options: $options }) { phase_field { id label options } } }' variables='{"id":"<field-id>","options":["High","Medium","Low"]}'create_phase_fieldexecute_graphql query='mutation($id: ID!, $options: [String!]) { updatePhaseField(input: { id: $id, options: $options }) { phase_field { id label options } } }' variables='{"id":"<field-id>","options":["High","Medium","Low"]}'Recipe 7 — Check phase transition rules
方案7 —— 检查阶段转换规则
When fails with "not a valid target phase":
move_card_to_phaseexecute_graphql query='query($id: ID!) { phase(id: $id) { id name cards_can_be_moved_to_phases { id name } } }' variables='{"id":"<current-phase-id>"}'Returns the valid destination phases from the current phase.
当返回错误“not a valid target phase”时:
move_card_to_phaseexecute_graphql query='query($id: ID!) { phase(id: $id) { id name cards_can_be_moved_to_phases { id name } } }' variables='{"id":"<current-phase-id>"}'返回当前阶段可跳转的有效目标阶段。
Optional schema cache
可选Schema缓存
For long-running agent sessions, the MCP can reuse the fetched GraphQL schema across requests instead of re-introspecting on every call. Enable via the setting (env or settings file). Off by default. After a breaking Pipefy schema change, the process must be restarted to pick up the new schema. Single-session agents rarely benefit — leave it off unless you measure real improvement.
gql_reuse_fetched_graphql_schema对于长时间运行的Agent会话,MCP可以在多个请求之间复用已获取的GraphQL Schema,而无需每次调用都重新内省。可通过设置(环境变量或配置文件)开启该功能,默认关闭。当Pipefy Schema发生破坏性变更后,必须重启进程才能获取新的Schema。单会话Agent很少能从中获益,除非你能衡量到实际性能提升,否则建议保持关闭状态。
gql_reuse_fetched_graphql_schemaSuccess criteria
成功标准
- returns the complete field list for the input type.
introspect_type - returns the expected data without errors.
execute_graphql
- 返回输入类型的完整字段列表。
introspect_type - 返回预期数据且无错误。
execute_graphql
Failure modes
失败场景
- returns
introspect_type— type name is case-sensitive; try PascalCase (e.g.,null, notCreateLabelInput).create_label_input - returns many hits — case-insensitive substring matching; broad keywords like
search_schemaflood results. Prefer specific names like"card","AiAgent"."FieldCondition" - is expensive — fetches all root mutation fields and filters client-side (single large query). Prefer
introspect_mutationon the specific input type when you already know the mutation name.introspect_type - returns GraphQL errors — check
execute_graphqlandpath; passmessageon the next call to surface thedebug=true.correlation_id - Endpoint confusion — introspection uses ; real operations use
app.pipefy.com/graphql. The MCP server handles this automatically; raw-API users must distinguish (see api-fallback).api.pipefy.com/graphql
- 返回
introspect_type—— 类型名称区分大小写;尝试使用帕斯卡命名法(例如null,而非CreateLabelInput)。create_label_input - 返回大量结果 —— 采用不区分大小写的子串匹配;像
search_schema这样宽泛的关键词会导致结果泛滥。建议使用更具体的名称,例如"card"、"AiAgent"。"FieldCondition" - 性能开销大 —— 会获取所有根mutation字段并在客户端过滤(单次大型查询)。如果已经知道mutation名称,优先使用
introspect_mutation查询对应的输入类型。introspect_type - 返回GraphQL错误 —— 检查
execute_graphql和path;下次调用时添加message参数以显示debug=true。correlation_id - 端点混淆 —— 内省使用;实际操作使用
app.pipefy.com/graphql。MCP服务器会自动处理这一差异;直接调用API的用户必须区分两者(详见api-fallback)。api.pipefy.com/graphql
See also
另请参阅
- docs/mcp/tools/introspection.md — MCP parameters, query/mutation mismatch hints on .
execute_graphql - skills/api-troubleshoot/pipefy-api-fallback/SKILL.md — Tier 3: direct HTTP fallback when MCP is unavailable.
- skills/pipes-and-cards/pipefy-pipes-and-cards/SKILL.md — most common dedicated tools (prefer over ).
execute_graphql
- docs/mcp/tools/introspection.md —— MCP参数说明、的查询/mutation不匹配提示。
execute_graphql - skills/api-troubleshoot/pipefy-api-fallback/SKILL.md —— Tier 3:当MCP不可用时的直接HTTP备用方案。
- skills/pipes-and-cards/pipefy-pipes-and-cards/SKILL.md —— 最常用的专用工具(优先于使用)。
execute_graphql