A complete working Python agent that creates HubSpot contacts, logs calls, and sweeps deal pipelines as individual users — not a shared integration account — using Scalekit to handle all auth.
User connects HubSpot once via OAuth (Scalekit vaults the token)
Your agent calls list_scoped_tools to get ~17 HubSpot tools in Anthropic's native format, no schema writing
Standard Claude tool-use loop: Claude picks the right tools, your code calls execute_tool with a user identifier, Scalekit makes the HubSpot API call as that specific user
Logging a call, updating a deal stage, creating a contact: these are the tasks that chip away at a sales rep's day. Your Claude agent can handle them. You describe what needs to happen in plain language, and the agent figures out which HubSpot tools to call and in what order.
This post shows a working Claude agent connected to HubSpot through Scalekit. You get copy-paste Python code, three workflow demos, and a full list of available HubSpot tools.
Connected account for user_123 is active.
Discovered N tools
[Tool calls happen here]
Found 3 deals in Proposal stage with no recent activity: ...
(Exact tool count and output will vary. Run against your HubSpot connection to see your data.)
What Your Agent Can Do
These three workflows show the range of tasks the agent handles. Each starts with a natural language prompt and ends with a concrete CRM action.
Qualify a lead
"Create a contact for Sarah Chen at Acme Corp and add her to the Q3 outreach list"
The agent calls hubspot_contact_create with name and company, then adds her to the specified list. You get back: "Contact Sarah Chen created at Acme Corp. Added to Q3 Outreach list."
Log a sales interaction
"Log a 20-minute call with Sarah Chen — we discussed pricing and she's ready to evaluate"
The agent calls hubspot_call_log with duration, subject, and the associated contact. You get back: "Call logged: 20 min, subject 'Pricing discussion', linked to Sarah Chen."
Pipeline sweep
"Find all deals in Proposal stage with no activity in 14 days and move them to Stalled"
The agent calls hubspot_deals_search to find matching deals, then hubspot_deal_update on each one. You get back: "Found 3 deals. Updated all to Stalled stage."
The pipeline sweep demo is also the default prompt in the agent script above. Change it to any of these or write your own.
The USER_IDENTIFIER env var (the identifier variable in the code) is how this scales from one user to many. Change it per user and each person gets their own HubSpot connection with their own permissions. Scalekit stores and refreshes OAuth tokens separately for each identifier.
In production, resolve the identifier from your authenticated session: after your app verifies who is making the request via session cookie, JWT, or database lookup. Never accept it from client input. The same agent code serves every user without modification.