Skip to content

Commit 97a0130

Browse files
authored
Slugify on title (#6)
* Slugify on title * Update version
1 parent fcc3df6 commit 97a0130

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@deco/mcp",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"exports": "./mod.ts",
55
"tasks": {
66
"check": "deno fmt && deno lint && deno check mod.ts"

mcp/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ export const getTools = <TManifest extends AppManifest>(
162162

163163
// Handle tool name slugification and clashes
164164
let toolName = (funcDefinition as { name?: string })?.name ??
165-
(inputSchema as { name?: string })?.name ?? slugify(resolveType);
165+
(inputSchema as { name?: string })?.name ??
166+
slugify(funcDefinition.title ?? resolveType);
166167
let idx = 1;
167168

168169
while (

mcp/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ export function dereferenceSchema(
2727
}
2828
visited.add(refId);
2929
const referencedSchema = definitions[refId];
30-
30+
3131
// Save the original schema metadata (excluding $ref)
3232
const { $ref, ...originalMetadata } = schema;
33-
33+
3434
// Merge the original metadata with the dereferenced schema
3535
return {
3636
...originalMetadata,

0 commit comments

Comments
 (0)