List all saved UI templates, including built-in seed templates. Returns template summaries (id, name, description, data_description).
(runtime: ToolRuntime)
| 139 | |
| 140 | @tool |
| 141 | def list_templates(runtime: ToolRuntime): |
| 142 | """ |
| 143 | List all saved UI templates, including built-in seed templates. |
| 144 | Returns template summaries (id, name, description, data_description). |
| 145 | """ |
| 146 | state_templates = runtime.state.get("templates", []) |
| 147 | state_ids = {t["id"] for t in state_templates} |
| 148 | templates = [*state_templates, *(s for s in SEED_TEMPLATES if s["id"] not in state_ids)] |
| 149 | return [ |
| 150 | { |
| 151 | "id": t["id"], |
| 152 | "name": t["name"], |
| 153 | "description": t["description"], |
| 154 | "data_description": t["data_description"], |
| 155 | "version": t["version"], |
| 156 | } |
| 157 | for t in templates |
| 158 | ] |
| 159 | |
| 160 | |
| 161 | @tool |
nothing calls this directly
no outgoing calls
no test coverage detected