Skip to content

Fetch.mjs only checks main.routes, ignores main.tools #51

@a6b8

Description

@a6b8

Problem

Fetch.mjs (v2 pipeline) hardcodes main['routes'][routeName] to find the route definition. v3.0.0 schemas use main['tools'] instead of main['routes']. This causes ALL v3.0.0 schemas to fail with:

Cannot read properties of undefined (reading 'toolName')

Root Cause

// src/v2/task/Fetch.mjs line 14
const route = main['routes'][ routeName ]

v3.0.0 schemas export main.tools, not main.routes. The key was never checked.

Fix

const routesObj = main['tools'] || main['routes'] || {}
const route = routesObj[ routeName ]

Affected Files

  • flowmcp-core/src/v2/task/Fetch.mjs (permanent fix)
  • flowmcp-cli/node_modules/flowmcp/src/v2/task/Fetch.mjs (temporary — overwritten on npm ci)

Impact

  • All v3.0.0 schemas fail when executed via flowmcp test single or flowmcp call
  • v2.0.0 schemas with main.routes are unaffected (backwards compatible)

Reproduction

flowmcp test single schemas/v3.0.0/flowmcp-community/providers/ohlcv/olhcv-moralis-evm.mjs
# → Cannot read properties of undefined (reading 'getOhlcvEvm')

Metadata

Metadata

Assignees

No one assigned

    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