Your first working agent only needs to call one tool. Start with a read-only tool like list_notes.
Let's think about this for a second
Connecting a tool means telling the model "call it like this," then you run the function yourself and feed the result text back in. This first step doesn't need a pile of APIs. All you need is one function that returns a list of filenames, and one loop iteration. Get that working before adding a read tool. Don't try to add search, read, write, and send all at once.
Let's connect this to everyday life
Set up a fake notes folder: photosynthesis.md, algebra.md, history.md. Have list_notes() return just those three names. Ask the agent, "What notes do I have?" The correct answer names exactly those three files — the model shouldn't invent extra ones. Don't move on until this test passes. Even without Node.js set up yet, you can do this on paper: write out "tool result = …" and "model reply = …" by hand.
Let's try it out together
const NOTES = ["photosynthesis.md", "algebra.md", "history.md"];
function listNotes() {
return { files: NOTES };
}
// Agent sees only this result, then answers the user.
console.log(listNotes());You'll connect a read-only tool to the agent loop and get it to show an accurate list.5-minute try
Write out the list_notes result for a fake folder yourself. Then compare what the agent should say versus a wrong answer when asked "what files exist?"
A quick word of caution
Don't let your first tool see the entire disk. Restrict it to a single lesson folder.