diff --git a/CHANGELOG.md b/CHANGELOG.md index e3f7d5c1b..2062b8309 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Fixed +- Help AI agents discover every shape supported by `create_shape`. (#448) - Keep `fill="none"` and `stroke="none"` SVG paths transparent when rendering inline artwork. (#446) - Match regional browser languages to supported locales without selecting a secondary language. (#417) - Save auto-layout frames that stretch their children to `.fig` without failing. (#427) diff --git a/packages/core/src/tools/create/basic.ts b/packages/core/src/tools/create/basic.ts index 8c624afc3..fd756616b 100644 --- a/packages/core/src/tools/create/basic.ts +++ b/packages/core/src/tools/create/basic.ts @@ -5,7 +5,7 @@ export const createShape = defineTool({ name: 'create_shape', mutates: true, description: - 'Create a shape on the canvas. Use FRAME for containers/cards, RECTANGLE for solid blocks, ELLIPSE for circles, TEXT for labels, SECTION for page sections.', + 'Create a shape on the canvas. Use FRAME for containers/cards, RECTANGLE for solid blocks, ELLIPSE for circles, TEXT for labels, LINE for rules and dividers, STAR for starbursts and badges, POLYGON for triangles and regular polygons, and SECTION for page sections. Use create_vector with an SVG path for arbitrary shapes.', params: { type: { type: 'string', diff --git a/tests/engine/tools/create.test.ts b/tests/engine/tools/create.test.ts index 06cc4a417..820dd89f9 100644 --- a/tests/engine/tools/create.test.ts +++ b/tests/engine/tools/create.test.ts @@ -28,6 +28,14 @@ describe('create_shape', () => { expect(node.height).toBe(400) }) + test('names every supported node type in the tool description', () => { + const tool = getTool('create_shape') + const supportedTypes = tool.params.type.enum ?? [] + + expect(supportedTypes.length).toBeGreaterThan(0) + expect(supportedTypes.filter((type) => !tool.description.includes(type))).toEqual([]) + }) + test('creates nested inside parent', () => { const { figma } = setupToolTest() const tool = getTool('create_shape')