The agent has access to two categories of tools:
Native Anthropic Tools : Built-in capabilities (code_execution, web_search, memory, web_fetch)
Custom Tools : Application-specific tools for Canvas, Todos, and Study
code_execution
Run Python code in a sandboxed environment.
Features :
Files persist across conversation (~4.5 minute timeout)
Access to standard Python libraries
Can call other tools programmatically via await toolName(params)
Supports asyncio for parallel operations
Configuration :
code_execution : anthropic . tools . codeExecution_20250825 ()
web_search
Search the web for current information.
Features :
Location-aware results using user’s city, region, country
Maximum 5 searches per conversation
Returns snippets with URLs
Configuration :
web_search : anthropic . tools . webSearch_20250305 ({
userLocation: {
type: "approximate" ,
city: ctx . city ,
country: ctx . country ,
region: ctx . region ,
timezone: ctx . timezone ,
},
})
memory
Store and retrieve persistent user information with a filesystem-like interface.
Operation to perform: view, create, str_replace, insert, delete, rename
File path (must start with /memories)
Configuration :
memory : anthropic . tools . memory_20250818 ({
execute : async ( action ) => {
return await executeMemoryCommand ( ctx . userId , action );
},
})
See Memory System for detailed documentation.
web_fetch
Fetch and process web content.
Configuration :
web_fetch : anthropic . tools . webFetch_20250910 ()
searchContent
Semantic search across Canvas course content.
Student’s question or search query
Returns :
[
{
content: {
name: string ,
allowed_attempts: number ,
className: string ,
description? : string ,
due_at? : string ,
lock_at? : string
},
id: string ,
metadata: {
classId: number ,
type: string
},
score: number // 0-1 relevance score
}
]
Allowed Callers : Direct and code_execution
Implementation :
// apps/web/src/ai/tools/canvas/search-content.ts
export const searchContentTool = tool ({
description: "Search for assignments, announcements, and other course information..." ,
inputSchema: z . object ({
query: z . string (). describe ( "Student's question" ),
}),
execute : async ({ query }) => {
return await queryCanvasIndex ( query );
},
providerOptions: {
anthropic: {
allowedCallers: [ "direct" , "code_execution_20250825" ],
cacheControl: { type: "ephemeral" },
},
},
});
getClassAssignments
Programmatic only : Can only be called from within code_execution
Fetch assignments from Canvas LMS.
Canvas class ID. If omitted, fetches from ALL classes in parallel
Optional filter: past, overdue, undated, ungraded, unsubmitted, upcoming, future
Returns :
[
{
id: number ,
name: string ,
description: string ,
due_at: string | null ,
points_possible: number ,
submission: { submitted_at: string | null },
_classId: string , // Added when fetching all classes
_className: string // Added when fetching all classes
}
]
Usage Example :
import json
# Fetch from all classes
result = await getClassAssignments({})
assignments = json.loads(result)
# Fetch from specific class with filter
result = await getClassAssignments({
"classId" : "12345" ,
"filter" : "upcoming"
})
upcoming = json.loads(result)
Implementation :
// apps/web/src/ai/tools/canvas/get-class-assignments.ts
export const getClassAssignmentsTool = tool ({
description: "Fetch assignments from Canvas LMS..." ,
inputSchema: z . object ({
classId: z . string (). optional (),
filter: z . enum ([ ... ]). optional (),
}),
execute : async ({ classId , filter }) => {
// Fetch logic with parallel processing for all classes
},
providerOptions: {
anthropic: {
allowedCallers: [ "code_execution_20250825" ],
cacheControl: { type: "ephemeral" },
},
},
});
All Todo tools are programmatic only : Can only be called from code_execution
getTodos
Fetch user’s todos filtered by view.
today: Scheduled for today or overdue
upcoming: Scheduled in the future
anytime: No specific date
someday: Later/maybe
active: All uncompleted
logbook: Completed items
For logbook view only: limit number of results (default 50)
Returns : JSON string containing array of todo objects
Usage Example :
import json
# Get today's todos
todos_json = await getTodos({ "view" : "today" })
todos = json.loads(todos_json)
for todo in todos:
print ( f " { todo[ 'title' ] } - Due: { todo.get( 'dueDate' ) } " )
createTodo
Create a new todo item.
Optional detailed description
When to work on it:
calendar: Specific date/time
calendarEvening: Evening of date
anytime: No specific time (default)
someday: Later/maybe
ISO date string for when to work on it (for calendar/calendarEvening types)
ISO date string for deadline
Array of subtask objects: [{ id: string, title: string, checked: boolean }]
Type of Canvas content: assignment, page, quiz, discussion
Canvas content ID (e.g., assignment ID)
Usage Example :
# Create todo linked to Canvas assignment
await createTodo({
"title" : "Complete Math Homework" ,
"description" : "Chapter 5 exercises 1-20" ,
"dateType" : "calendar" ,
"scheduledDate" : "2026-03-08T14:00:00Z" ,
"dueDate" : "2026-03-10T23:59:00Z" ,
"canvasContentType" : "assignment" ,
"canvasContentId" : 12345 ,
"canvasClassId" : 67890
})
updateTodo
Update an existing todo item.
Mark as complete/incomplete
ISO date string for new scheduled date
ISO date string for new due date
Usage Example :
# Mark todo as complete
await updateTodo({
"id" : "todo-uuid-here" ,
"checked" : True
})
# Reschedule todo
await updateTodo({
"id" : "todo-uuid-here" ,
"scheduledDate" : "2026-03-12T10:00:00Z"
})
deleteTodo
Delete a todo permanently.
Usage Example :
await deleteTodo({ "id" : "todo-uuid-here" })
createStudySet
Create flashcards or practice questions for studying.
Display mode: flashcards, multiple-choice, short-answer
Array of study items (see below)
Item Types :
{
type : "term" ,
tags : string [] | null ,
term : string ,
shortDefinition : string ,
fullDefinition : string
}
Question (Multiple Choice)
{
type : "question" ,
tags : string [] | null ,
prompt : string ,
thinking : string | null ,
explanation : string | null ,
options : Array < { correct : boolean , text : string } >
}
Features :
Supports LaTeX for math formulas: $$x^2 + y^2 = z^2$$
Multiple display modes for different learning styles
Tag-based organization
Allowed Callers : Direct and code_execution
Usage Example :
Flashcards
Multiple Choice
await createStudySet({
"displayMode" : "flashcards" ,
"title" : "Calculus I - Chapter 3" ,
"items" : [
{
"type" : "term" ,
"tags" : [ "derivatives" ],
"term" : "Power Rule" ,
"shortDefinition" : "$$ \\ frac {d}{dx} [x^n] = nx^{n-1}$$" ,
"fullDefinition" : "The derivative of x to the power of n equals n times x to the power of n minus 1."
},
{
"type" : "term" ,
"tags" : [ "derivatives" , "trigonometry" ],
"term" : "Derivative of sin(x)" ,
"shortDefinition" : "$$ \\ frac {d}{dx} [ \\ sin(x)] = \\ cos(x)$$" ,
"fullDefinition" : "The derivative of sine x is cosine x."
}
]
})
Implementation :
// apps/web/src/ai/tools/study/flashcards.ts
export const createStudySetTool = tool ({
description: "Create flashcards or practice questions for studying..." ,
inputSchema: createStudySetToolInput ,
execute : async ( data ) => {
return `Study set " ${ data . title } " created successfully with ${ data . items . length } items...` ;
},
providerOptions: {
anthropic: {
allowedCallers: [ "direct" , "code_execution_20250825" ],
cacheControl: { type: "ephemeral" },
},
},
});
All tools are configured in apps/web/src/ai/agents/general.ts:
export function getGeneralAgentTools ( ctx : AgentContext ) : Record < string , any > {
return {
// Native Anthropic tools
code_execution: anthropic . tools . codeExecution_20250825 (),
memory: anthropic . tools . memory_20250818 ({ execute: ... }),
web_search: anthropic . tools . webSearch_20250305 ({ userLocation: ... }),
web_fetch: anthropic . tools . webFetch_20250910 (),
// Canvas LMS
searchContent: searchContentTool ,
getClassAssignments: getClassAssignmentsTool ,
// Todo management
getTodos: getTodosTool ,
createTodo: createTodoTool ,
updateTodo: updateTodoTool ,
deleteTodo: deleteTodoTool ,
// Study tools
createStudySet: createStudySetTool ,
};
}
Provider Options
All custom tools include provider-specific configuration:
providerOptions : {
anthropic : {
allowedCallers : [ "direct" , "code_execution_20250825" ],
cacheControl : { type : "ephemeral" },
},
}
allowedCallers : Restricts where tool can be invoked
"direct": Can be called directly by the model
"code_execution_20250825": Can be called from Python code
cacheControl : Uses ephemeral caching to reduce latency
Next Steps
General Agent Learn about the system prompt and capabilities
Memory System Deep dive into persistent user memory