1. Tool name
name is the identifier the model emits when it decides to call this tool.
name: "get_weather",Typorithm · medium
Step 1 of 8 · intro card
Tools & Agents
You describe tools with a name, description, and JSON input_schema. When useful, the model emits a tool_use block with arguments; your code runs the real function and returns a tool_result, then the model continues toward an answer.
A tool is just a description: a name, a plain-English description of what it does, and a JSON input_schema for its arguments. You send this list with the request so the model knows what it can call.
When the model decides a tool would help, it does not run anything itself — it emits a tool_use block naming the tool and supplying arguments that match your input_schema.
Your code executes the real function (call an API, query a database), then sends the output back as a tool_result. The model reads that result and continues toward its final answer.
A tool = name + description + input_schema.
The model emits tool_use; your code runs it.
You return a tool_result so the model can continue.
const tools = [{
name: "get_weather",
description: "Get weather for a city",
input_schema: { type: "object", properties: { city: { type: "string" } } },
}];
// model returns tool_use; you run it and return tool_resultConnect each part of the code to the concept before you type.
name is the identifier the model emits when it decides to call this tool.
name: "get_weather",description tells the model what the tool does and when to reach for it — write it for the model.
description: "Get weather for a city",input_schema is JSON Schema describing the arguments the model must supply.
input_schema: { type: "object", properties: { city: { type: "string" } } },Each property names one argument and its type, so the model fills it in correctly.
city: { type: "string" }The model emits a tool_use block; your code runs the real function and returns a tool_result.
// model returns tool_use; you run it and return tool_resultRead the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.