iflytek/astron-agent · error · CustomException

MCP_ERROR

MCP_ERROR

Error message

MCP node output identifier is empty

What it means

After a successful MCP call, the node needs output_identifier — the field name(s) used to extract the tool result into node outputs. If output_identifier is empty, it raises CustomException MCP_ERROR because the result cannot be mapped to output variables.

Solutions

  1. Configure output_identifier (at least one entry) in the MCP node settings so the tool result is mapped to an output variable
  2. Re-open the node in the workflow editor, set the output variable, and re-save the workflow
  3. If the field is set programmatically, ensure it's a non-empty list, e.g. ["result"]

Example fix

// before
{"mcpServerId": "srv-123", "toolName": "web_search", "output_identifier": []}
// after
{"mcpServerId": "srv-123", "toolName": "web_search", "output_identifier": ["result"]}
Defensive patterns

Strategy: validation

Validate before calling

oid = node_config.get("output_identifier")
if not isinstance(oid, list) or len(oid) == 0 or not oid[0]:
    raise ValueError("MCP node requires a non-empty output_identifier, e.g. ['result']")

Type guard

def has_output_identifier(cfg: dict) -> bool:
    oid = cfg.get("output_identifier")
    return isinstance(oid, list) and len(oid) > 0 and bool(oid[0])

Try / catch

try:
    result = await node.async_execute(variable_pool, span)
except CustomException as e:
    if e.err_code == CodeEnum.MCP_ERROR:
        # prompt user to configure the node's output variable
        ...

Prevention

When it happens

Trigger: An MCP node configured with a valid server and tool but no output identifier configured (output variable mapping left blank), then executed successfully at the HTTP level but failing at the output-mapping step.

Common situations: User forgot to define the node's output variable in the workflow editor; an imported workflow JSON omitted output_identifier; UI field reset after editing the tool selection.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/7ad15a6042112310. Report an issue: GitHub.

Appendix: source

Thrown at core/workflow/engine/nodes/mcp/mcp_node.py:119

                    res_json = json.loads(await resp.text())
                    await span.add_info_events_async(
                        {"mcp_response": json.dumps(res_json, ensure_ascii=False)}
                    )

                    # Check for errors in response
                    if res_json.get("code") != 0:
                        msg = f"reason {res_json.get('message')}"
                        span.add_error_event(msg)
                        raise CustomException(
                            err_code=CodeEnum.MCP_REQUEST_ERROR,
                            err_msg=msg,
                            cause_error=msg,
                        )

            if not self.output_identifier:
                msg = "MCP node output identifier is empty"
                span.add_error_event(msg)
                raise CustomException(
                    err_code=CodeEnum.MCP_ERROR,
                    err_msg=msg,
                    cause_error=msg,
                )
            outputs = {self.output_identifier[0]: res_json.get("data", {})}
            return NodeRunResult(
                status=status,
                inputs=inputs,
                outputs=outputs,
                node_id=self.node_id,
                node_type=self.node_type,
                alias_name=self.alias_name,
            )
        except CustomException as err:
            span.add_error_event(str(err))
            span.record_exception(err)
            return NodeRunResult(
                inputs=inputs,

View on GitHub (pinned to 5e758547a8)