Skip to content

[power-automate][Bug] list_connections/invoke_operation build an invalid PPAPI hostname from a valid environment GUID (ENOTFOUND) #333

Description

@DSerrano-AI

Bug description

ppapiBaseUrl() in plugins/power-automate/server/mcp.mjs (v2.2.0) derives the Power Platform API hostname purely by string-slicing the environment GUID:

function ppapiBaseUrl(envId, templateOverride, suffixOverride) {
  const rawId = envId.replace(/^Default-/i, "");
  const hex = rawId.replace(/-/g, "");
  const prefix = hex.slice(0, 30);
  const shard = hex.slice(30, 32);
  ...
  return `https://${prefix}.${shard}.${suffix}`;
}

This produces a hostname that does not exist in DNS for our environment.

Steps to reproduce

  1. Set the current environment to a valid Dataverse environment, e.g. env: "Default-<your-environment-guid>".
  2. Call list_connections (or invoke_operation) against that environment.

Actual result

Flow API 0 NetworkError: Network request failed: ENOTFOUND (hostname: <prefix>.<shard>.environment.api.powerplatform.com). This often means the environment ID produced an invalid PPAPI URL. Verify the environment ID is a valid GUID.

Confirmed with a valid, correctly-formatted environment GUID (both plain GUID and Default-<guid> forms) — not an input-formatting issue.

Expected result

list_connections/invoke_operation should resolve the correct regional Power Platform API endpoint for the given environment (presumably via a real environment/instance lookup) rather than a static hex-slice of the GUID, and return connection data.

Environment

  • Plugin: power-automate (power-platform-skills marketplace), v2.2.0
  • Dataverse environment type: Default (non-Sandbox)
  • Reproduced consistently across both GUID and Default-<guid> env-id formats

Workaround

None found for list_connections/invoke_operation specifically. get_flow/get_flow_context still work and surface a flow's connection references, so we're using those instead.

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