{"uid":"cap_FSDzbiINTRFf9S21SWuU0","slug":"irantools-grapheme-count-206cd7b4","name":"IranTools Grapheme Count","description":"Persian and Iranian utilities for AI agents, plus general text/Unicode tooling. Jalali (Solar Hijri) calendar conversion, Iranian national ID / SHEBA / bank card / postal code / economic code validation, province and city lookup, official public holidays, Persian text normalization, keyword extraction, sentence splitting, similarity, HTML stripping, RTL fixing, Unicode homoglyph folding, script detection, NFC/NFD normalization, grapheme counting, date description, business-day counting, slugify, FNV-1a hashing, Shannon entropy, format and encoding detection, byte sizes. Pay per call in USDC on Base via x402 - no signup, no API key, no KYC. The same tools are also exposed as MCP tools at /mcp.","url":"https://irantools.johnaio281.workers.dev/api/iran/grapheme_count?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","required":["text"],"properties":{"text":{"type":"string"}}},"responseSchema":{"type":"object","additionalProperties":true},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","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.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ME_iskKMe6i_wC9EVrO32","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Counts the number of grapheme clusters (visible characters) in a string, correctly handling Unicode including Persian/Arabic text","exampleAgentPrompt":"How many visible characters are in this Persian text: 'سلام دنیا'? I need the real grapheme cluster count, not the raw byte or code-point length.","exampleUseCases":[{"title":"Validate Persian form field length","prompt":"Check how many visible characters are in this user-submitted Persian username 'علی‌رضا محمدی' — I need the true grapheme count to enforce my 20-character limit correctly."},{"title":"Measure tweet length for RTL content","prompt":"I'm building a Persian social media app — can you count the grapheme clusters in this string 'خوش‌آمدید به دنیای فارسی' so I know if it fits within a 50-character display limit?"},{"title":"Debug Unicode string mismatch","prompt":"My code says this Arabic string 'مُحَمَّد' has 12 code points but I see only 6 visible letters on screen — can you count the actual grapheme clusters so I can figure out what's happening?"}],"resultDescription":"Returns an object containing the grapheme cluster count of the input text — the number of user-perceived characters, correctly segmenting combining marks, zero-width joiners, emoji sequences, and multi-codepoint Persian/Arabic glyphs into single graphemes.","failureModes":["Missing required 'text' field returns a 400-level error","Extremely large input strings may time out or exceed payload limits","Non-string values for 'text' may return a validation error"],"whenToPreferThis":"Use this endpoint when you need the true visible character count of a Unicode string, especially for Persian, Arabic, or other scripts where a single glyph may span multiple code points or bytes. Prefer this over JavaScript's .length or Python's len() when working with combining characters, diacritics, or emoji, where those built-ins return code-unit or code-point counts rather than user-perceived character counts.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-22T12:41:48.931Z","isFirstParty":false,"canonicalSlug":"irantools-grapheme-count-206cd7b4"}