Skip to content

Specify format for tool names #277

@kentcdodds

Description

@kentcdodds

Is your feature request related to a problem? Please describe.

When I attempted to make some tools for my MCP server, I made a descriptive name that had spaces in it. This worked in the inspector, but broke in Cloud Desktop because Cloud Desktop doesn't like having spaces in tool names.

Describe the solution you'd like

I would like the format for the name to be specified so clients implement it consistently.

Additional context

Here's one of the tools I'm talking about:

server.tool(
	'Get blog post',
	// I guess I should call it get_blog_post to make it work in claude desktop?
	'Get the content of a specific blog post by its slug',
	{ slug: z.string().describe('The slug of the blog post to retrieve') },
	async ({ slug }) => {
		const { files } = await downloadMdxFilesCached('blog', slug, {})

		if (!files.length) {
			return {
				content: [
					{ type: 'text', text: `No blog post found with slug: ${slug}` },
				],
			}
		}

		return {
			content: files.map(
				(file) =>
					({
						type: 'text',
						text: `${file.path}:\n\n${file.content}`,
					}) as const,
			),
		}
	},
)

I personally don't really care what the format is. I mostly just want to make sure that it's specified so clients are consistent.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions