Your first tool
Tools give a model a schema, a description, and a server-side implementation. They run inside the deployed workspace, so keep provider credentials in the platform configuration or runtime environment rather than in browser code.
1. Create the tool
Section titled “1. Create the tool”Open Compute → Tools, create a tool, and use this source.
import type { Tool } from "@neutrome/lilsdk";
const weather: Tool = { name: "weather", description: "Get the current weather for a city.", schema: { type: "object", properties: { city: { type: "string", description: "City name" }, }, required: ["city"], additionalProperties: false, }, systemPromptFragment: "Use weather when the user asks about current weather.", async execute(args) { const city = String(args.city); return `Weather data for ${city} is not configured yet.`; },};
export default weather;Use precise description, schema, and systemPromptFragment values. They
are the instructions the model receives when the tool is attached.
2. Attach it to a model
Section titled “2. Attach it to a model”Select the model or models that should receive the tool, save, then deploy the
workspace. The deployment generator creates the createToolsExecutor() wrapper
for those attachments. Do not wrap the model source a second time.
3. Test a tool call
Section titled “3. Test a tool call”Ask the model a question that needs the tool. The model chooses whether to call it from the published schema. Tool results return as text to the model before it produces the final answer.