Cursor agent extra tools

Ive been seeing some chatter on x about the cursor agent. Apparently you can get it to run python functions you add to a file. Id like to for instance create a websearch function tool for agent to use. Is this possible and if so how is it done?