What the assistant gets
Tools
The server gives the assistant these tools to call:
search_docssearches the guides and the reference: packages, elements, commands, methods, built-in variables andkscriptcommands.read_docreads a whole page as Markdown: a guide (language,code-format,web...), a package (KScript.IO), a type's methods (string methods),variablesorcli.lookupgives everything about one name, such as<for>,@read_text,list->map,$argsorKScript.Math: its parameters and their types, the return type, retired v1 names and an example.list_make_commandslists thekscript maketemplates of your project (built in and_templates/) and the project templates.check_codechecks code or a file without running it, likekscript check, with your project's lint rules.format_codeformats code or a file likekscript fmt, with your project's format settings, and returns the result.convert_codeconverts between XML and.kscript, likekscript convert.run_coderuns a short script in the same sandbox as the docs' Run buttons, and returns what it printed.
Resources
Every page is also a resource, such as kscript://docs/guide/language or kscript://docs/reference/io, for assistants that let you attach resources to a chat.
Syntax and project
Examples come in your project's syntax: make.syntax in kscript.json, or .kscript outside a project. --syntax picks one for every call, and a tool call can ask for the other. The project is the folder the assistant starts the server in; --dir names another.
What the server may touch
Nothing the server does changes your files. check_code and format_code read a file only when the assistant passes its path, and only a script or page (.kscript, .ks.xml, .html, .md) inside the project folder. run_code runs in an empty temporary folder with no network and without your environment variables.