MCPcopy Create free account
hub / github.com/CopilotKit/OpenGenerativeUI / list_templates

Function list_templates

apps/agent/src/templates.py:141–158  ·  view source on GitHub ↗

List all saved UI templates, including built-in seed templates. Returns template summaries (id, name, description, data_description).

(runtime: ToolRuntime)

Source from the content-addressed store, hash-verified

139
140@tool
141def 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected