{"uid":"cap_aVlOrNQF64u93pxqwoSP_","slug":"agent402-iso-8601-duration-parser-5b0b478e","name":"Agent402 ISO-8601 Duration Parser","description":"Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.","url":"https://agent402.co.uk/v1/utils/duration","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"duration":{"type":"string","description":"ISO-8601 duration"}}},"responseSchema":{"type":"json","example":{"days":1,"hours":2,"valid":true,"minutes":30,"total_seconds":95400}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OmXLvqzFoHrGdt718YHAh","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Parses an ISO-8601 duration string (e.g. P1DT2H30M) into its component parts (days, hours, minutes, etc.) plus a total_seconds value","exampleAgentPrompt":"Can you parse the ISO-8601 duration 'P1DT2H30M' and tell me how many total seconds that is, along with the breakdown of days, hours, and minutes?","exampleUseCases":[{"title":"Scheduling agent interval parsing","prompt":"I have a recurring job set to run every P3DT12H — can you break that duration down into days and hours and also give me the total number of seconds so I can configure the scheduler?"},{"title":"API response duration decoding","prompt":"I'm getting back a duration value of PT45M30S from a third-party API — can you parse that into its minute and second components and tell me the total seconds?"},{"title":"User-input duration validation","prompt":"A user entered 'P2Y6M' as a subscription period — can you parse that ISO-8601 duration and confirm it's valid, showing me the years, months, and total seconds?"}],"resultDescription":"Returns a JSON object with the duration broken into components (days, hours, minutes, and any other applicable fields like years/months), a boolean 'valid' flag indicating whether the input was a valid ISO-8601 duration, and a 'total_seconds' integer representing the full duration in seconds.","failureModes":["Invalid or malformed ISO-8601 string returns valid: false","Missing 'duration' field in request body causes a 400-level error","Ambiguous durations involving months/years may use approximate second counts (e.g. 30-day month)","Empty string input likely returns valid: false with zeroed components"],"whenToPreferThis":"Use this endpoint when an agent needs to programmatically interpret an ISO-8601 duration string — especially for scheduling, countdown logic, or converting calendar-sourced intervals into machine-usable seconds. Prefer it over manual string parsing when accuracy and validation are both required in a single call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:54:57.396Z","isFirstParty":false}