extract_symbols
Parse math expressions to extract symbols with inferred type, SI unit, and description using optional context hints.
Instructions
Extract symbols from an expression with inferred metadata.
Args:
expression: Mathematical expression
context: Optional context hint (e.g., "mechanics", "thermodynamics")
Returns:
List of symbols with:
- name: Symbol name
- type: Inferred type (real, positive_real, integer, etc.)
- suggested_unit: Suggested SI unit based on context
- description: Inferred description
Examples:
extract_symbols("F = m*a", context="mechanics")
→ [
{"name": "F", "type": "real", "suggested_unit": "N", "description": "Force"},
{"name": "m", "type": "positive_real", "suggested_unit": "kg", "description": "Mass"},
{"name": "a", "type": "real", "suggested_unit": "m/s²", "description": "Acceleration"}
]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | ||
| expression | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||