Skip to content

[power-automate][Bug] diagnose_run throws "ctx.getClient(...).diagnoseRun is not a function" #328

Description

@AJx03

Plugin

power-automate

Plugin Version

2.2.0

Skill / Command

debug-flow

Bug Description

Calling the diagnose_run MCP tool always throws a TypeError instead of returning a diagnosis, for any valid flow/run combination. The same class of bug (an unwired/missing method on the FlowAgent client) was already tracked for edit_flow in #314, now fixed by PR #318 (adding FlowClient.editFlow()). copy_flow has the same unfixed pattern in #289/#294. This appears to be the same root cause affecting diagnoseRun, which doesn't yet have its own issue.

Steps to Reproduce

  1. Have a flow with at least one failed run (any cloud flow, any environment).
  2. Call diagnose_run with a valid flow (flow ID) and run (run ID) that get_run_actions can successfully retrieve for the same flow/run.
  3. Observe the tool call fails immediately.

Expected Behavior

diagnose_run returns the classified failed/timed-out actions with a remediation for each, as described in its tool definition.

Actual Behavior

Tool call fails with:

TypeError: ctx.getClient(...).diagnoseRun is not a function

get_run_actions works fine against the same flow/run, confirming the run/flow IDs and connection are valid — the failure is isolated to diagnose_run's client wiring.

Relevant Logs / Screenshots

{
  "code": "tool-error",
  "message": "ctx.getClient(...).diagnoseRun is not a function",
  "errorName": "TypeError"
}

Environment

  • OS: Microsoft Windows 11 Enterprise, 10.0.26100.0
  • Claude Code version: 2.1.220 (Claude Code)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions