
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI can see the issue in your code! You're trying to add a custom tool through studio.components.toolMenu, but that's not the correct approach. The toolMenu component is for customizing how the tool menu renders, not for adding new tools themselves.
The correct way is to add your custom tool directly to the tools array at the root level of your config, not through studio.components.
Here's how to fix it:
First, define your custom tool (as an object, not a function):
import { Card, Text } from '@sanity/ui'
const MyCustomComponent = () => {
return (
<Card padding={4}>
<Text>My custom tool content</Text>
</Card>
)
}
export const myCustomTool = {
name: 'my-custom-tool',
title: 'My Custom Tool',
component: MyCustomComponent,
icon: () => '🔧', // optional icon
}Then add it to your config's tools array:
import { defineConfig } from 'sanity'
import { myCustomTool } from './myCustomTool'
export default defineConfig({
// ... other config like projectId, dataset, etc.
tools: [
myCustomTool,
// other default tools will still be included
],
// ... rest of your config
})Or if you want to preserve all existing tools and add yours:
export default defineConfig({
tools: (prev) => [...prev, myCustomTool],
// ... other config
})Key points:
studio.components.toolMenu customization entirelymyCustomTool should be an object with name, title, and component properties (not a function call like myCustomTool())tools array at the root of defineConfig(), not inside studio.componentsThis approach works regardless of whether your Studio runs on port 3333 or at /studio on localhost:3000 - the routing configuration doesn't affect how you define tools.
For more details, check out the official Studio tools documentation and the Tool API reference.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store