feat(tool): create_lead MCP tool for enterprise contact (POST /api/v1/leads)#48
Merged
Merged
Conversation
…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
enabled auto-merge (rebase)
July 5, 2026 13:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CreateLeadParams/LeadResulttypes andcreateLead()method toclient.tscreate_leadMCP tool toindex.ts— callsPOST /api/v1/leads, no auth required, authenticated callers auto-link to their teamPOST /api/v1/leadsroute tomock-api.tswith email validation andleadCount()countertool-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_leadcaptures the inquiry in-flow and reaches the instanode.dev team directly.Test plan
INSTANODE_MCP_NO_LISTEN=1 node --test --test-name-pattern="J31" dist-test/test/tool-contract.test.js🤖 Generated with Claude Code