Overview
The/api/metadata endpoint returns information about the AI agents and tools available in Maxw AI. This endpoint is useful for discovering capabilities, displaying tool information in UI, and understanding agent architecture.
This endpoint is simplified for the current architecture where only the general agent is active. It returns hardcoded metadata with a 1-hour cache duration.
Endpoint
Authentication
No authentication required. This endpoint returns public metadata about agent capabilities.Response Schema
Array of available agents in the system
Array of all tools available across agents
Response Example
Current Agent: General
The general agent is the primary AI assistant with comprehensive capabilities:Native Anthropic Tools
code_execution
code_execution
Run Python code in a sandboxed environment for:
- Mathematical calculations and data processing
- Programmatic tool calling (batch operations)
- File manipulation within persistent container
- Complex filtering and transformations
web_search
web_search
Search the web for current information:
- Location-aware results based on user geolocation
- Maximum 5 searches per conversation
- Ideal for queries about “latest”, “current”, or “recent” information
- Returns search results with titles, snippets, and URLs
memory
memory
Persistent user memory system:
- Filesystem-like interface (create, read, update, delete)
- Store user preferences, facts, goals, and context
- Retrieved automatically across conversations
- Enables personalized responses without re-asking questions
web_fetch
web_fetch
Fetch and process web content:
- Download HTML, JSON, or text from URLs
- Extract structured information from web pages
- Process documentation, articles, or API responses
Custom Integration Tools
searchContent
searchContent
Canvas LMS semantic searchSearches across student’s course content:
- Assignments and due dates
- Course pages and materials
- Syllabus documents
- Discussion topics
getClassAssignments
getClassAssignments
Programmatic Canvas assignment fetchingOnly callable from within
code_execution blocks:- Fetch from all classes or a specific class
- Returns full assignment data for filtering
- Ideal for date-based queries (“due this week”)
- Can be combined with todo creation
getTodos
getTodos
Programmatic todo retrievalFetch user’s tasks with filtering:
- Views: today, upcoming, anytime, someday, active, logbook
- Returns full todo objects with Canvas links
- Includes subtasks and scheduling metadata
createTodo
createTodo
Programmatic todo creationCreate tasks from within code execution:
- Link to Canvas assignments automatically
- Support scheduled dates and due dates
- Add subtasks as structured data
- Batch create multiple todos efficiently
updateTodo
updateTodo
Programmatic todo updatesModify existing tasks:
- Mark complete/incomplete
- Change dates and scheduling
- Update subtasks
- Move between date types (calendar, anytime, someday)
deleteTodo
deleteTodo
Programmatic todo deletionPermanently remove tasks from the system.
createStudySet
createStudySet
Study material generationCreate flashcard sets for studying:
- Generate term/definition pairs
- Extract key concepts from content
- Support for practice questions
Currently simplified - enhanced features planned for future releases.
Programmatic Tool Calling
Many tools are designed for programmatic calling only, meaning they can only be invoked from within Pythoncode_execution blocks:
Why Programmatic Calling?
Reduced Latency
No round trips to the model between tool calls
Token Savings
Filter data in Python before adding to context
Conditional Logic
Make decisions based on intermediate results
Batch Operations
Process multiple items efficiently in parallel
Example Pattern
Caching
The metadata endpoint includes aggressive caching:Use Cases
Tool Discovery
Display available tools in chat UI or documentation
Capability Checks
Verify which features are available before showing UI
Agent Architecture
Understand system capabilities for integration
Documentation
Auto-generate tool reference documentation
Implementation Details
Source:apps/web/src/app/api/metadata/route.ts
View Full Implementation
View Full Implementation
Error Handling
Unexpected server error during metadata generation
Future Enhancements
The metadata endpoint is designed to support future expansion:- Multiple agents: Specialized agents for different domains
- Dynamic tool registration: Tools loaded at runtime
- Tool schemas: Full JSON schema definitions for validation
- Agent capabilities: Fine-grained capability flags (streaming, multimodal, etc.)
- Version information: API versioning and compatibility
Related Documentation
Streaming Chat API
Main chat endpoint with tool execution
Agent Configuration
System prompt and tool setup
Custom Tools
Tool implementation details
Canvas Integration
Canvas LMS data synchronization