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
| Name | Required | Description | Default |
|---|---|---|---|
| function | Yes | Function name to analyze | |
| maxAgeSeconds | No | Freshness 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. |