Overview
The Tools API provides all functionality for managing AI tools in AiVault. It includes queries for fetching tools with various filters, mutations for submitting and moderating tools, and statistics endpoints.Queries
getTools
Fetch a filtered and sorted list of approved tools. Source:/home/daytona/workspace/source/convex/tools.ts:28
Filter by category (e.g., “Chatbots”, “Image Generation”). Use “All” to skip filtering.
Filter by pricing model: “Free”, “Freemium”, or “Paid”. Use “All” to skip filtering.
Search query to match against tool name, description, or tags (case-insensitive).
Sort order: “newest” (default) or “upvotes”
Array of approved tools matching the filters
getToolBySlug
Fetch a single tool by its URL slug. Source:/home/daytona/workspace/source/convex/tools.ts:86
URL-friendly tool identifier
Tool object if found, null otherwise
getToolById
Fetch a single tool by its ID. Source:/home/daytona/workspace/source/convex/tools.ts:96
Unique tool identifier
Tool object if found, null otherwise
getRelatedTools
Fetch related tools in the same category, sorted by upvotes. Source:/home/daytona/workspace/source/convex/tools.ts:103
Tool category to match
Slug of tool to exclude from results (typically the current tool)
Up to 4 approved related tools, sorted by upvotes
getFeaturedTools
Fetch all featured tools. Source:/home/daytona/workspace/source/convex/tools.ts:118
Parameters: None
Array of featured tools, sorted by creation date (newest first)
getSubmittedTools
Fetch all tools submitted by the authenticated user. Source:/home/daytona/workspace/source/convex/tools.ts:128
Authentication: Required
Parameters: None
Array of tools submitted by the current user (both approved and pending)
getPendingTools
Fetch all tools pending approval. Source:/home/daytona/workspace/source/convex/tools.ts:139
Authentication: Admin required
Parameters: None
Array of unapproved tools
getStats
Fetch public platform statistics. Source:/home/daytona/workspace/source/convex/tools.ts:234
Parameters: None
Platform statistics
getAdminStats
Fetch detailed statistics including pending tools. Source:/home/daytona/workspace/source/convex/tools.ts:254
Authentication: Admin required
Parameters: None
Detailed platform statistics
Mutations
submitTool
Submit a new tool for approval. Source:/home/daytona/workspace/source/convex/tools.ts:149
Authentication: Required
Tool name
Short description (1-2 sentences)
Detailed description
Tool category (e.g., “Chatbots”, “Image Generation”)
Array of tags
Tool website URL
Tool logo URL
Pricing model: “Free”, “Freemium”, or “Paid”
Detailed pricing information (e.g., “Free tier available. Pro from $20/mo”)
Array of features
Array of use cases
Array of pros
Array of cons
Supported platforms (“Web”, “iOS”, “Android”, “Desktop”, “API”, “Chrome Extension”)
Twitter profile URL
GitHub repository URL
Discord server URL
Submission result
- Slug is automatically generated from the name
- If slug already exists, timestamp is appended
- Tool starts with
approved: false(requires admin approval) - Tool is marked with
isNew: true - Initial upvotes set to 0
approveTool
Approve a pending tool submission. Source:/home/daytona/workspace/source/convex/tools.ts:207
Authentication: Admin required
ID of the tool to approve
Whether to send approval email to submitter (not yet implemented)
rejectTool
Reject and delete a pending tool submission. Source:/home/daytona/workspace/source/convex/tools.ts:219
Authentication: Admin required
ID of the tool to reject
Rejection reason to send to submitter
Whether to send rejection email to submitter (not yet implemented)
upvoteTool
Increment the upvote count for a tool. Source:/home/daytona/workspace/source/convex/tools.ts:284
ID of the tool to upvote
void
Errors:
"Tool not found"- If toolId doesn’t exist