The short answer
code_execution is the xAI SDK tool that lets Grok run Python. Use Calculator Tools when that calculation should be a public app. Connect MCP. The assistant calls webappCreate and returns a calculator.tools URL.
The SDK call stays on xAI's side. The hosted app stays on your account.
What this call does
xAI's tool overview shows code_execution in the Python SDK (xai_sdk.tools.code_execution) and the tool type code_interpreter in HTTP examples. Both are server-side code tools. See code_interpreter for the shared name.
The model sends code. The API returns output the model can quote. There is no calculator.tools app id in that response.
Grok on the web can show the work in the conversation. Closing the conversation does not publish a page here.
What Calculator Tools does
Calculator Tools turns the formula into a static web app: inputs, a result, and a URL.
Files live in one directory. HTML, CSS, JavaScript, and other static files are the whole app.
You stay the owner. Free accounts can publish 3 apps. Pro ($5.99/month) raises the limit to 25.
How to use MCP for this job
Grok's built-in tool list does not publish to this host. Use an MCP client that can.
Add https://api.calculator.tools/mcp/ in Cursor, Claude, or ChatGPT. Sign in with Google. Click Approve.
Tell the assistant the formula Grok just ran. Ask it to publish a calculator. It calls webappCreate, then webappfileCreate for the page files.
You can also open Create and describe the same formula. No SDK call is required.
Limits
Calculator Tools does not wrap code_execution. It does not bill xAI tool runs. It does not store Grok's sandbox files.
If the work needs those Python libraries at request time, keep the sandbox. If the work is a form people reuse, publish here. Check the numbers.
Next step
Open Create or connect MCP. The first 3 apps are free.
Sources
Ready to publish a public app you own?