check_deprecated_code
Identify deprecated code and technical debt in legacy systems or during upgrades. Analyze code snippets and dependencies within specific technologies like React or Node.js to streamline modernization efforts.
Instructions
Automatically call this tool when reviewing legacy code, planning upgrades, or encountering warnings with real time web access. Helps identify technical debt. Example: During code reviews or before upgrading dependencies.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The code snippet or dependency to check | |
| technology | No | The technology or framework context (e.g., "React", "Node.js") |
Implementation Reference
- src/server/PerplexityServer.ts:138-144 (handler)The handler function that implements the core logic of the 'check_deprecated_code' tool by querying the search engine with a deprecation check prompt.private async handleCheckDeprecatedCode(args: Record<string, unknown>): Promise<string> { const typedArgs = args as { code: string; technology?: string }; const searchResult = await this.searchEngine.performSearch( `Check if this ${typedArgs.technology || "code"} is deprecated: ${typedArgs.code}`, ); return searchResult; }
- src/schema/toolSchemas.ts:292-342 (schema)The schema definition for the 'check_deprecated_code' tool, including input/output schemas, description, examples, and metadata.name: "check_deprecated_code", description: "Automatically call this tool when reviewing legacy code, planning upgrades, or encountering warnings with real time web access. Helps identify technical debt. Example: During code reviews or before upgrading dependencies.", category: "Code Analysis", keywords: ["deprecation", "migration", "upgrade", "compatibility", "linting", "legacy", "debt"], use_cases: [ "Preparing for technology upgrades", "Maintaining backward compatibility", "Identifying technical debt", ], inputSchema: { type: "object", properties: { code: { type: "string", description: "The code snippet or dependency to check", examples: ["componentWillMount()", "var instead of let/const"], }, technology: { type: "string", description: 'The technology or framework context (e.g., "React", "Node.js")', examples: ["React 16", "Python 2.7", "Node.js 12"], }, }, required: ["code"], }, outputSchema: { type: "object", properties: { response: { type: "string", description: "The raw text response from Perplexity analyzing the code for deprecated features.", }, }, }, examples: [ { description: "React lifecycle method deprecation", input: { code: "componentWillMount() {\n // initialization code\n}", technology: "React", }, output: { response: "componentWillMount is deprecated in React 17+. Use constructor or componentDidMount instead...", }, }, ], related_tools: ["get_documentation", "search"], },
- src/server/PerplexityServer.ts:175-186 (registration)The registration of the 'check_deprecated_code' tool handler in the server's tool registry.private setupToolHandlers(): void { const toolHandlers = createToolHandlersRegistry({ chat_perplexity: this.handleChatPerplexity.bind(this), get_documentation: this.handleGetDocumentation.bind(this), find_apis: this.handleFindApis.bind(this), check_deprecated_code: this.handleCheckDeprecatedCode.bind(this), search: this.handleSearch.bind(this), extract_url_content: this.handleExtractUrlContent.bind(this), }); setupToolHandlers(this.server, toolHandlers); }
- src/types/tools.ts:49-52 (helper)Type definition for the arguments accepted by the 'check_deprecated_code' tool.export interface CheckDeprecatedCodeArgs { code: string; technology?: string; }