The Tools API allows you to search, discover, and execute TPMJS tools programmatically.
GET /api/tools
Retrieve a paginated list of tools with optional filtering.
limit - Number of results (default: 20, max: 50)offset - Pagination offsetcategory - Filter by categoryq - Search querycurl "https://tpmjs.com/api/tools?category=communication&limit=10"{
"success": true,
"data": [
{
"id": "clx123abc",
"name": "discordPostTool",
"description": "Post messages to Discord channels",
"qualityScore": 0.85,
"package": {
"npmPackageName": "@tpmjs/discord-post",
"category": "communication"
}
}
],
"pagination": {
"limit": 10,
"offset": 0,
"hasMore": true
}
}GET /api/tools/:id
Retrieve detailed information about a specific tool.
id - Tool ID or package/tool slugcurl "https://tpmjs.com/api/tools/@tpmjs/discord-post/discordPostTool"POST /api/tools/execute/:slug
Execute a tool with an AI agent. Returns streaming SSE response.
{
"prompt": "Send a hello message to #general channel",
"parameters": {
"channel": "#general"
}
}import { executeToolCall } from '@tpmjs/registry-execute';
const result = await executeToolCall({
toolId: '@tpmjs/discord-post/discordPostTool',
prompt: 'Send hello to #general',
apiKey: 'your-api-key',
onChunk: (text) => console.log(text),
});
console.log(result.output);GET /api/tools/trending
Get trending tools based on downloads, ratings, and activity.
period - Time period: day, week, month, all (default: week)category - Filter by categorylimit - Number of results (default: 20)curl "https://tpmjs.com/api/tools/trending?period=week&limit=10"POST /api/tools/:id/rate
Rate a tool from 1-5 stars. Requires authentication.
{
"rating": 5
}{
"success": true,
"data": {
"userRating": 5,
"averageRating": 4.5,
"ratingCount": 42
}
}