Skip to main content
Glama
wysh3

Perplexity MCP Server

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
NameRequiredDescriptionDefault
codeYesThe code snippet or dependency to check
technologyNoThe technology or framework context (e.g., "React", "Node.js")

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
responseNoThe raw text response from Perplexity analyzing the code for deprecated features.

Implementation Reference

  • 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;
    }
  • 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"],
    },
  • 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);
    }
  • Type definition for the arguments accepted by the 'check_deprecated_code' tool.
    export interface CheckDeprecatedCodeArgs {
      code: string;
      technology?: string;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions 'real time web access,' hinting at external data fetching, but doesn't disclose key behavioral traits such as whether it's read-only, if it makes network calls, potential rate limits, or what the output looks like. This is inadequate for a tool that likely interacts with external sources.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two sentences that directly address usage and purpose. It's front-loaded with key scenarios, though the second sentence could be more tightly integrated to avoid slight redundancy in examples.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, 100% schema coverage, and an output schema exists), the description is reasonably complete. It covers usage contexts well, and since an output schema is present, it doesn't need to explain return values, though it could benefit from more behavioral details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('code' and 'technology') with descriptions and examples. The description doesn't add any meaning beyond what the schema provides, such as explaining how parameters interact or their impact on results, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Helps identify technical debt' through checking deprecated code. It specifies the action ('identify') and resource ('technical debt'), though it doesn't explicitly differentiate from sibling tools like 'find_apis' or 'get_documentation' which might also relate to code analysis.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: 'when reviewing legacy code, planning upgrades, or encountering warnings with real time web access.' It includes specific scenarios like 'During code reviews or before upgrading dependencies,' which clearly defines the context without mentioning alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/wysh3/perplexity-mcp-zerver'

If you have feedback or need assistance with the MCP directory API, please join our Discord server