Skip to content

Commit 3e95a8b

Browse files
authored
Merge pull request #645 from modelcontextprotocol/ihrpr/remove-custom-title-util
remove hasCustomTitle
2 parents 8b9aa20 + 741a201 commit 3e95a8b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/shared/metadataUtils.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,15 @@ export function getDisplayName(metadata: BaseMetadata): string {
1515
if (metadata.title !== undefined && metadata.title !== '') {
1616
return metadata.title;
1717
}
18-
18+
1919
// Then check for annotations.title (only present in Tool objects)
2020
if ('annotations' in metadata) {
2121
const metadataWithAnnotations = metadata as BaseMetadata & { annotations?: { title?: string } };
2222
if (metadataWithAnnotations.annotations?.title) {
2323
return metadataWithAnnotations.annotations.title;
2424
}
2525
}
26-
26+
2727
// Finally fall back to name
2828
return metadata.name;
2929
}
30-
31-
/**
32-
* Checks if an object has a custom title different from its name.
33-
*/
34-
export function hasCustomTitle(metadata: BaseMetadata): boolean {
35-
return metadata.title !== undefined && metadata.title !== metadata.name;
36-
}

0 commit comments

Comments
 (0)