
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@toolroute/hook
Advanced tools
Auto-route every agent task through ToolRoute. Install once, every task gets the best tool and model recommendation.
Auto-route every agent task through ToolRoute. Install once — every task gets the best MCP server and LLM model recommendation, automatically.
npm install @toolroute/hook
import { createHook } from '@toolroute/hook'
const hook = createHook({
agentName: 'my-agent',
verbose: true, // logs routing decisions
})
// Register (optional, earns 2x credits)
await hook.register()
// Wrap any task — routing + reporting happens automatically
const result = await hook.run('scrape competitor pricing data', async (routing) => {
console.log(`Best tool: ${routing.skillName}`) // e.g., "Firecrawl MCP"
console.log(`Best model: ${routing.model}`) // e.g., "claude-haiku-4-5-20251001"
console.log(`Confidence: ${routing.confidence}`)
// ... your actual task logic here ...
return { prices: [29, 49, 99] }
})
console.log(result.data) // { prices: [29, 49, 99] }
console.log(result.executionMs) // 1847
console.log(result.creditsEarned) // 5
const routing = await hook.route('draft an email to a client')
// routing.skill → "gmail-mcp"
// routing.model → "claude-haiku-4-5-20251001"
// routing.confidence → 0.87
// Set bypass: true to skip routing — compare routed vs unrouted performance
const hook = createHook({ bypass: Math.random() > 0.5 })
POST /api/route with your task descriptionhook.route() returned model: null for every call because it read
recommended_model.alias / .recommended_alias — fields that don't exist
on the /api/route response. Now reads recommended_model.slug.hook.run() called reportOutcome() twice per task on the success
path (once in the finally block, once after). Telemetry was double-counted.
Now fires exactly one POST /api/contributions per task on both success
and failure paths.FAQs
Auto-route every agent task through ToolRoute. Install once, every task gets the best tool and model recommendation.
The npm package @toolroute/hook receives a total of 10 weekly downloads. As such, @toolroute/hook popularity was classified as not popular.
We found that @toolroute/hook demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.