Skip to content
LearningPathX
Learning PathsFree TestsExam InfoHow it worksNews
Sign inChoose a certification
  1. Home/
  2. Certifications/
  3. CCAR-F/
  4. CCAR-F Learning Path/
  5. Study FAQs/
  6. How should I normalize tool results in a Claude Agent SDK workflow?

Study FAQ

How should I normalize tool results in a Claude Agent SDK workflow?

Exam · CCAR-FKnowledge domain · Tool Design & MCP IntegrationUpdated Dec 4, 2026
Also asked as 2
  • How can an Agent SDK result adapter preserve timestamp units, status meanings, and errors?
  • What should I retain when converting different tools' outputs into a common format?

Answer

Normalize from each tool's documented contract, and retain the raw result, tool identity, and any conversion failure. A common representation is useful only when it preserves the meaning of the original data.

For timestamps, establish whether a numeric value means Unix seconds or milliseconds. Require a timezone or offset for text that must identify an instant. Convert an established instant to the chosen representation, such as UTC; leave an ambiguous local time unresolved. For status codes, use a mapping specific to the source tool. An unfamiliar code remains unknown rather than becoming success.

Keep execution and normalization outcomes separate. A tool may execute successfully but return a timestamp that cannot be interpreted. A timeout is an execution failure, not an empty successful result. A useful application-owned record includes the source tool, raw value, declared format, normalized value, and conversion status.

Place pre-action enforcement before dispatch. Use post-result processing for data the tool has already returned. In the current Agent SDK hook contract, PostToolUse can append additionalContext or replace output with updatedToolOutput for built-in and MCP tools; the older updatedMCPToolOutput applies only to MCP output. Match the fields to your installed SDK. An executor wrapper can also normalize its own return value.

Test a valid conversion, missing or malformed time, absent timezone, unknown status, and execution failure. Inspect what the consumer actually receives and preserve the failure if delivery or conversion fails. Post-processing cannot undo an external action.

Agent SDK hooks

Full explanation

Apply Agent SDK hooks for tool call interception and data normalization

Learning material · CCAR-F

Read the full explanation →
← Back to CCAR-F FAQsView learning path →

Related questions

Who executes Claude API tools, and where should authorization happen? →How do I design a narrow input contract for a Claude client tool? →Where should an MCP integration enforce consent, access, and isolation? →How do MCP hosts, clients, and servers divide responsibilities and expose capabilities? →How does MCP 2025-06-18 initialization negotiate versions and capabilities? →What should a Claude tool executor do when a write times out? →
LearningPathX

A focused path to certification, one clear step at a time.

© 2026 LearningPathX. All rights reserved.

Product

CertificationsLearning PathsFree TestsHow it worksNews

Company

SubscriptionHelp centerContact usPrivacyTerms

Follow us

Your privacy choices

We use analytics cookies to understand how LearningPathX is used and improve your learning experience. Analytics will only start after you accept.