Skip to content

feat(tool): create_lead MCP tool for enterprise contact (POST /api/v1/leads)#48

Merged
mastermanas805 merged 5 commits into
masterfrom
feat/capture-lead-tool-fresh
Jul 5, 2026
Merged

feat(tool): create_lead MCP tool for enterprise contact (POST /api/v1/leads)#48
mastermanas805 merged 5 commits into
masterfrom
feat/capture-lead-tool-fresh

Conversation

@mastermanas805

Copy link
Copy Markdown
Member

Summary

  • Add CreateLeadParams / LeadResult types and createLead() method to client.ts
  • Add create_lead MCP tool to index.ts — calls POST /api/v1/leads, no auth required, authenticated callers auto-link to their team
  • Add POST /api/v1/leads route to mock-api.ts with email validation and leadCount() counter
  • Add J31 contract tests in tool-contract.test.ts (success + 400 missing_email)

Why

Agents hitting Pro limits (dedicated infra, SSO, compliance) previously had no in-tool path to escalate — they would have had to ask the user to email manually. create_lead captures the inquiry in-flow and reaches the instanode.dev team directly.

Test plan

  • CI passes (build + unit tests)
  • J31 tests pass locally: INSTANODE_MCP_NO_LISTEN=1 node --test --test-name-pattern="J31" dist-test/test/tool-contract.test.js

🤖 Generated with Claude Code

mastermanas805 and others added 5 commits June 14, 2026 10:00
…e contact

Wires POST /api/v1/leads in the MCP client layer. Only email is
required; name/company/use_case are optional enrichment. Authenticated
callers auto-link the lead to their team. Prerequisite for the
create_lead MCP tool.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Agents hitting Pro limits (or needing dedicated infra/SSO/compliance)
previously had no in-tool path to escalate — they would have had to
ask the user to email contact@instanode.dev manually. create_lead
calls POST /api/v1/leads directly so the agent can capture the inquiry
in-flow. No auth required; token callers auto-link the lead to their team.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…v1/leads

Adds POST /api/v1/leads to the mock-api (email validation, leadCount()
counter) and two J31 contract tests: success path (anon caller, no token
required) and 400 missing_email error. Covers the full mock→tool→response
chain for the new enterprise contact surface.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…LS, rename name→contact_name

- tool-coverage.test.ts: bump expected count 30→31 + add J31/create_lead entry
- index.ts: rename name→contact_name in create_lead schema to avoid the
  provisioning-name API regex guard (create_lead is a contact form, not a
  resource provision — it has no resource name field)
- tool-contract.test.ts: update J31 test to pass contact_name instead of name

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-schema check

- Add create_lead to integration.test.ts EXPECTED_TOOLS array (30→31)
- Update test title to reflect 31 tools
- Exclude create_lead from create_* name-schema check (it is a contact
  form, not a resource provisioning tool, so it has no name field)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mastermanas805
mastermanas805 enabled auto-merge (rebase) July 5, 2026 13:46
@mastermanas805
mastermanas805 merged commit eba9e5f into master Jul 5, 2026
8 of 9 checks passed
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.

1 participant