Skip to main content
Glama

Find LLM SDK calls in code

promptguard_scan_code
Read-onlyIdempotent

Analyze code for LLM SDK usage patterns (OpenAI, Anthropic, Cohere, Google Gemini, Bedrock). Detects import statements and client instantiations via pattern matching. When to use: After generating new code that uses LLM SDKs, when reviewing pull requests, or when auditing a codebase for security coverage gaps.

Input Schema

NameRequiredDescriptionDefault
codeYesThe code content to analyze for LLM SDK usage

Output Schema

NameRequiredDescriptionDefault
kindYes
summaryYes
providersYes
recommendationNo
totalDetectionsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered elsewhere. The description adds real value by disclosing the mechanism ('pattern matching' on imports and client instantiations), which tells the agent results are heuristic and bounded to the five listed SDKs, but it says nothing about result shape or what happens with non-matching or mixed-language input.

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

Conciseness5/5

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

Two tight sentences: capability and mechanism first, then triggers, with zero repeated field names or filler. Nothing could be removed without losing information.

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?

For a one-parameter, read-only tool with an output schema and full annotation coverage, the description supplies what is needed to invoke it correctly. The remaining gap is routing: it never positions itself against promptguard_scan_text or points to promptguard_redact as the natural next step.

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?

With a single parameter at 100% schema description coverage, the schema already explains that 'code' is the content to analyze. The description adds no format, size, or language constraints for that input, so it sits at the structural baseline rather than exceeding it.

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?

States a specific verb and resource ('Analyze code for LLM SDK usage patterns') and narrows scope to a named vendor list plus import statements and client instantiations. The sibling promptguard_scan_text is not named, so the code-vs-text distinction must be inferred from the tool names rather than stated.

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

Usage Guidelines4/5

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

An explicit 'When to use' clause gives three concrete triggers: after generating LLM-SDK code, during PR review, and for audit coverage gaps. It stops short of exclusions or naming promptguard_scan_text/promptguard_redact as the follow-on or alternative path.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources