Skip to content

engine.mcp.tool-timeout emits gateway toolTimeout as a string #30994

Closed

Description

@szabta89

Problem

engine.mcp.tool-timeout is documented and validated as a Go duration string in gh-aw workflow frontmatter, for example:

engine:
  id: copilot
  mcp:
    tool-timeout: "5m"

However, the generated MCP gateway config currently passes that value through as a JSON string:

{
  "gateway": {
    "port": "${MCP_GATEWAY_PORT}",
    "domain": "${MCP_GATEWAY_DOMAIN}",
    "apiKey": "${MCP_GATEWAY_API_KEY}",
    "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}",
    "toolTimeout": "5m"
  }
}

The MCP gateway schema for gateway.toolTimeout expects integer seconds, not a duration string:

"toolTimeout": {
  "type": "integer",
  "description": "Tool invocation timeout in seconds. The gateway enforces this timeout for individual tool/method calls to MCP servers.",
  "minimum": 10,
  "default": 60
}

As a result, a workflow that uses the documented engine.mcp.tool-timeout shape can compile successfully but fail at runtime when the MCP gateway starts:

Location: /gateway/toolTimeout
Error: expected integer, but got string

Why this is separate from #30634

This is related to #30634, but appears to be a remaining, separate compatibility issue.

#30634 / #30686 addresses propagation of engine.mcp.tool-timeout from imported shared workflows into consumers. That improves where the timeout value can come from, but the propagated value is still a duration string such as "5m". Unless the compiler converts that value before writing the gateway JSON, or the gateway accepts duration strings, the imported value can still produce an invalid MCP gateway config.

Expected behavior

A workflow author should be able to use the documented setting:

engine:
  id: copilot
  mcp:
    tool-timeout: "5m"

and get a runtime-valid gateway config, for example:

"toolTimeout": 300

Alternatively, the MCP gateway could accept Go duration strings for gateway.toolTimeout, but the compiler and gateway schema/runtime need to agree on the contract.

Actual behavior

The compiler emits:

"toolTimeout": "5m"

and the gateway rejects it because gateway.toolTimeout is an integer field.

Suggested fixes

Any of these would resolve the mismatch:

  1. Convert engine.mcp.tool-timeout duration strings to integer seconds when rendering gateway.toolTimeout.
  2. Change the MCP gateway schema/runtime to accept Go duration strings for gateway.toolTimeout.
  3. Derive gateway toolTimeout from the effective tools.timeout value as integer seconds, while keeping engine.mcp.tool-timeout as an explicit override with clear conversion semantics.

Notes

MCP_GATEWAY_TOOL_TIMEOUT=300 works as a lower-level workaround because the gateway already parses that environment variable as integer seconds. But workflow authors are encouraged to use the frontmatter setting, so the documented engine.mcp.tool-timeout path should produce gateway-valid config without needing the env-var workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions