Skip to content

Commit c8f4758

Browse files
committed
tool: expose the deprecated attribute
Expose the `deprecated` attribute and default to `false`.
1 parent 8ee9fc3 commit c8f4758

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/parser/extract-tools.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ export function extractToolsFromApi(
9090
const securityRequirements =
9191
operation.security === null ? globalSecurity : operation.security || globalSecurity;
9292

93+
const deprecated = operation.deprecated || false;
94+
9395
// Create the tool definition
9496
tools.push({
9597
name: finalToolName,
@@ -102,6 +104,7 @@ export function extractToolsFromApi(
102104
requestBodyContentType,
103105
securityRequirements,
104106
operationId: baseName,
107+
deprecated,
105108
});
106109
}
107110
}

src/types/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ export interface McpToolDefinition {
6262
securityRequirements: OpenAPIV3.SecurityRequirementObject[];
6363
/** Original operation ID from the OpenAPI spec */
6464
operationId: string;
65+
/** OpenAPI deperecated attribute **/
66+
deprecated: boolean;
6567
}
6668

6769
/**

0 commit comments

Comments
 (0)