Skip to content

refactor(tools): harness-agnostic tool definitions#57

Merged
Patrik Simek (patriksimek) merged 1 commit into
mainfrom
harness-agnostic-tools
Apr 23, 2026
Merged

refactor(tools): harness-agnostic tool definitions#57
Patrik Simek (patriksimek) merged 1 commit into
mainfrom
harness-agnostic-tools

Conversation

@patriksimek

Copy link
Copy Markdown
Member

Summary

Makes the MCP-specific tool definitions harness-agnostic so the same
shape can power the MCP server, @makehq/cli, and future
integrations without duplicate adapters.

  • *.mcp.ts*.tools.ts. New canonical MakeTool /
    MakeTools exports from a new ./tools subpath;
    MakeMCPTool / MakeMCPTools stay as @deprecated aliases.
  • resourceId names the input property for the single resource
    a tool operates on (get/update/delete/run-style actions).
  • identifierscopeId to disambiguate from OAuth scope
    and from the new resourceId. identifier stays as a
    @deprecated alias and is kept in sync on every tool (enforced
    by unit tests).

Backward compatibility

  • All new fields (scopeId, resourceId) are additive and optional.
  • MakeMCPTool / MakeMCPTools / identifier still export with
    unchanged shape/values; mirror invariants enforced by tests.
  • Minor version bump is appropriate.

Test plan

  • npm run lint — clean
  • npm test — 206/206 pass across 28 suites
  • Invariants enforced by new unit tests:
    • every tool with resourceId / scopeId has the named key in
      inputSchema.properties
    • scopeId === identifier on every tool
    • spot checks for executions_get / executions_get-detail
      (scenarioId + executionId) and credential-requests_get
      (requestId)
    • every _list / _create and every sdk-* tool has
      resourceId === undefined

Copilot AI review requested due to automatic review settings April 23, 2026 22:06
@patriksimek Patrik Simek (patriksimek) requested a review from a team as a code owner April 23, 2026 22:06
@patriksimek Patrik Simek (patriksimek) merged commit e918ffa into main Apr 23, 2026
6 checks passed
@patriksimek Patrik Simek (patriksimek) deleted the harness-agnostic-tools branch April 23, 2026 22:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the SDK’s tool metadata into a harness-agnostic MakeTool / MakeTools shape so the same tool definitions can be consumed by MCP, the CLI, and future integrations without duplicate adapters.

Changes:

  • Introduces src/tools.ts as the canonical tool-definition aggregator (MakeTool, MakeTools) and adds the new @makehq/sdk/tools export subpath.
  • Keeps MCP compatibility via deprecated aliases in src/mcp.ts (MakeMCPTool, MakeMCPTools) that point to the canonical definitions.
  • Adds scopeId / resourceId metadata across endpoint tool definitions and enforces invariants via expanded Jest coverage.

Reviewed changes

Copilot reviewed 31 out of 32 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tsup.config.ts Adds src/tools.ts as a build entrypoint so dist/tools.* is published.
test/mcp.spec.ts Switches tests to MakeTools and adds invariants for scopeId / resourceId / identifier.
src/tools.ts New canonical tool types and aggregated MakeTools list.
src/mcp.ts Converts MCP exports into deprecated aliases backed by ./tools.
src/endpoints/users.tools.ts Adds scopeId metadata (explicitly undefined) for consistency with invariants.
src/endpoints/teams.tools.ts Adds scopeId / resourceId to team tools.
src/endpoints/sdk/webhooks.tools.ts Adds scopeId metadata (explicitly undefined) for SDK tools.
src/endpoints/sdk/rpcs.tools.ts Adds scopeId metadata (explicitly undefined) for SDK tools.
src/endpoints/sdk/modules.tools.ts Adds scopeId metadata (explicitly undefined) for SDK tools.
src/endpoints/sdk/functions.tools.ts Adds scopeId metadata (explicitly undefined) for SDK tools.
src/endpoints/sdk/connections.tools.ts Adds scopeId metadata (explicitly undefined) for SDK tools.
src/endpoints/sdk/apps.tools.ts Adds scopeId metadata (explicitly undefined) for SDK tools.
src/endpoints/scenarios.tools.ts Adds scopeId / resourceId to scenario tools.
src/endpoints/organizations.tools.ts Adds scopeId / resourceId to organization tools.
src/endpoints/keys.tools.ts Adds scopeId / resourceId to key tools.
src/endpoints/incomplete-executions.tools.ts Adds scopeId / resourceId to incomplete execution tools.
src/endpoints/hooks.tools.ts Adds scopeId / resourceId to hook tools.
src/endpoints/functions.tools.ts Adds scopeId / resourceId to custom function tools.
src/endpoints/folders.tools.ts Adds scopeId / resourceId to folder tools.
src/endpoints/executions.tools.ts Adds scopeId / resourceId to execution tools.
src/endpoints/enums.tools.ts Adds scopeId metadata (explicitly undefined) for enum tools.
src/endpoints/devices.tools.ts Adds scopeId metadata to device tools.
src/endpoints/data-structures.tools.ts Adds scopeId / resourceId to data structure tools.
src/endpoints/data-stores.tools.ts Adds scopeId / resourceId to data store tools.
src/endpoints/data-store-records.tools.ts Adds scopeId / resourceId to record tools.
src/endpoints/credential-requests.tools.ts Adds scopeId / resourceId to credential-request tools.
src/endpoints/connections.tools.ts Adds scopeId / resourceId to connection tools.
scripts/run-mcp-server.mjs Updates the local MCP server runner to use MakeTools from dist/tools.js.
package.json Bumps version and adds ./tools export mapping to dist/tools.*.
package-lock.json Updates lockfile version metadata for the release bump.
README.md Updates docs from MCP-specific tools to harness-agnostic @makehq/sdk/tools usage.
AGENTS.md Updates contributor guidance from *.mcp.ts to *.tools.ts and registration via src/tools.ts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tools.ts
/** Detailed description of what the tool does */
description: string;

/** Category for organizing tools (e.g., 'scenarios', 'teams', 'sdk.apps') */

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MakeTool.category JSDoc example uses sdk.apps, but the repo conventions (and updated docs in AGENTS.md) use kebab-case for SDK categories (e.g. sdk-apps). Update the example to avoid documenting an invalid category format.

Suggested change
/** Category for organizing tools (e.g., 'scenarios', 'teams', 'sdk.apps') */
/** Category for organizing tools (e.g., 'scenarios', 'teams', 'sdk-apps') */

Copilot uses AI. Check for mistakes.
Comment thread src/tools.ts
* required to run the tool (e.g. `scenarios:read`); `scopeId` names the
* input property, `scope` names the permission.
*
* The value SHOULD be a key in {@link inputSchema}.properties when set.

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scopeId JSDoc says its value SHOULD be a key in inputSchema.properties, but the new unit test suite enforces this as a hard invariant when scopeId is set. Consider changing the wording to MUST (or relaxing the test) so the documentation matches the enforced behavior.

Suggested change
* The value SHOULD be a key in {@link inputSchema}.properties when set.
* The value MUST be a key in {@link inputSchema}.properties when set.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants