Perform the work
The final function runs when the tool is called.
async () => ({
content: [
{
type: "text",
text: new Date().toISOString(),
},
],
})
new Date() reads the computer's clock. toISOString() turns that moment into a standard text form.
The server wraps the text in MCP's result shape and sends it back.
# citations