Functions

core

Built-in. No import needed.

plus minus times over modarithmetic
eq neq lt gt lte gtecomparison
and or notlogical

math

math abs xabsolute value
math min x yminimum
math max x ymaximum
math floor xround down
math ceil xround up
math round xround nearest
math sqrt xsquare root
math pow x ypower
math log xnatural log
math sin xsine
math cos xcosine
math random0 to 1

str

str len slength
str concat a bjoin
str split s sepsplit
str trim swhitespace
str upper suppercase
str lower slowercase
str contains s subhas substring
str replace s old newreplace all
str slice s start endsubstring

list

list len llength
list get l iat index
list set l i vset index
list push l vappend
list pop lremove last
list first lfirst element
list last llast element
list slice l start endsublist
list reverse lreverse
list sort lsort
list map l fntransform
list filter l fnkeep matching
list reduce l fn initfold

time

time nowunix ms
time dateISO string
time parse sparse string
time format t fmtformat
time year tget year
time month tget month
time day tget day

err

err new msgcreate error
err msg eget message
err is xcheck if error
err wrap e msgadd context

http

http get urlGET request
http post url bodyPOST request
http put url bodyPUT request
http delete urlDELETE request
http patch url bodyPATCH request
... with "H" "V"add header
... auth bearer "tok"Bearer auth
... auth basic "u" "p"Basic auth

mcp

Model Context Protocol - three primitives: Tools (actions), Resources (data), Prompts (templates).

mcp tools urllist tools
mcp use url tool argsuse a tool
mcp resources urllist resources
mcp read url uriread resource
mcp prompts urllist prompts
mcp prompt url name argsget prompt
mcp init urlinit session
mcp log url levelset log level

llm

llm claude promptCall Claude

json

json parse sparse string
json string xto JSON
json get x pathget field
json set x path vset field
json has x pathfield exists