Skip to main content
Glama

analyze_function

Analyze a Lambda function to surface infrastructure issues—table access patterns, queue publishing, secret usage, and trigger event shapes—before writing or reviewing the handler.

Instructions

Analyzes a single named function or Lambda handler for infrastructure issues: which tables it queries, how it queries them (scan vs query), queue publishing, secret access, and the correct event shape for each trigger (SQS, DynamoDB Streams, Kinesis, EventBridge). Call this before writing or reviewing a Lambda handler to get the exact trigger event shape and all findings scoped to this function. Per-file detail (file, accesses, missingPermissions) is returned in matches, one entry per source file defining a function with this name; ambiguous: true means the name matched several files, so pick the entry whose file you are actually editing instead of assuming the first. Returns found: false if the function name was not discovered during analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
functionYesFunction name to analyze
maxAgeSecondsNoFreshness tolerance in seconds. Advisory: the answer is returned either way, with dataHealth.withinRequestedAge reporting whether it met the tolerance. Nothing re-reads AWS on a tool call — run `infrawise analyze` to refresh. Pass a small value for point-in-time questions ("does this queue have a DLQ right now"); omit it for architecture questions where a day-old snapshot is fine.
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so thoroughly. It discloses per-file `matches` entries, the `ambiguous: true` flag and how to handle it, `found: false` on missed functions, and the advisory nature of `maxAgeSeconds` with no AWS re-read. This goes beyond surface-level behavior.

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?

The description front-loads the core purpose and each subsequent sentence adds unique value: matches structure, ambiguity handling, false return, and usage timing. It is longer than a single sentence but every clause earns its place, making it economical and well-structured.

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

Completeness5/5

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

For a focused analysis tool with no output schema, the description covers all key facets: what is analyzed, return structure, ambiguity handling, failure mode, and usage guidance. It also explains the provenance of the data (no AWS re-read), making the tool's contract sufficiently complete.

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?

The input schema already provides full descriptions for both parameters (100% coverage), including the advisory semantics of `maxAgeSeconds` and the meaning of `function`. The tool description adds no additional parameter-level meaning beyond the schema, so the baseline of 3 applies.

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

Purpose5/5

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

The description clearly states 'Analyzes a single named function or Lambda handler for infrastructure issues' and enumerates specific analyses (tables, scan vs query, queue publishing, secret access, event shapes). It distinguishes itself from sibling overview tools like get_lambda_overview by emphasizing single-function scope and trigger-specific event shapes.

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?

It explicitly directs the user to 'Call this before writing or reviewing a Lambda handler' and notes that findings are 'scoped to this function,' which clarifies when to use it. It does not explicitly name alternatives or exclusions, but the contrast with broader overview tools is clear.

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

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/Sidd27/infrawise'

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