Skill 3.3.3

Convert structured data to JSON for language model processing

Key Concepts

FOR JSON PATH turns a result set into a JSON array with property names from column aliases, and dotted aliases nest properties; WITHOUT_ARRAY_WRAPPER returns a single object. JSON_OBJECT and JSON_ARRAYAGG build the same structures inline, which is convenient inside a larger JSON_OBJECT for the request. INCLUDE_NULL_VALUES or NULL ON NULL decide whether empty properties appear.

Only the columns the model needs should be sent, with clear names (for example price_usd rather than p), an identifier for citations, and text truncated or chunked to fit the context window. Sensitive columns are excluded, because the content leaves the database. Retrieved rows are ordered by relevance and limited to the top few, which reduces cost and keeps the model focused.