@lovelybunch/mcp 1.0.75-alpha.8 → 1.0.75-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -5,5 +5,6 @@ export { architectureContextTool } from './architecture-context-tool.js';
5
5
  export { roleContextTool } from './role-context-tool.js';
6
6
  export { knowledgeTool, createKnowledgeToolCall, normalizeKnowledgeMetadata, buildKnowledgeActionPayload } from './knowledge-tool.js';
7
7
  export type { KnowledgeActionPayload, KnowledgeActionType, KnowledgeDocument, KnowledgeDocumentMetadata } from './knowledge-tool.js';
8
+ export { resourcesTool } from './resources-tool.js';
8
9
  export type { MCPTool, MCPToolCall } from './proposals-tool.js';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACtJ,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACtJ,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EACV,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA"}
package/dist/index.js CHANGED
@@ -4,4 +4,5 @@ export { projectContextTool } from './project-context-tool.js';
4
4
  export { architectureContextTool } from './architecture-context-tool.js';
5
5
  export { roleContextTool } from './role-context-tool.js';
6
6
  export { knowledgeTool, createKnowledgeToolCall, normalizeKnowledgeMetadata, buildKnowledgeActionPayload } from './knowledge-tool.js';
7
+ export { resourcesTool } from './resources-tool.js';
7
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACtJ,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACtJ,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,qBAAqB,CAAA;AAO5B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA"}
@@ -24,7 +24,7 @@ const metadataSchema = {
24
24
  };
25
25
  export const knowledgeTool = {
26
26
  name: 'knowledge_documents',
27
- description: 'Manage knowledge base markdown documents stored in .nut/context/knowledge. IMPORTANT: When searching for documents by topic or keyword, always use the query parameter to filter results server-side. The returned count reflects filtered results.',
27
+ description: 'Manage knowledge base markdown documents stored in .nut/knowledge. IMPORTANT: When searching for documents by topic or keyword, always use the query parameter to filter results server-side. The returned count reflects filtered results.',
28
28
  parameters: {
29
29
  type: 'object',
30
30
  properties: {
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge-tool.js","sourceRoot":"","sources":["../src/knowledge-tool.ts"],"names":[],"mappings":"AAuCA,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,kEAAkE;IAC/E,UAAU,EA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ACF,CAAA;AAED,MAAM,UAAU,uBAAuB,CAAC,SAAiB,EAAE,IAA6B;IACtF,OAAO;QACL,IAAI,EAAE,qBAAqB;QAC3B,SAAS,EAAE;YACT,SAAS;YACT,GAAG,IAAI;SACR;KACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,QAA2C;IACpF,4EAA4E;IAC5E,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,EAAE,EAAE,iEAAiE;QAC9E,GAAG,QAAQ;QACX,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;QAC9C,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;QACvD,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;QACvD,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;KAC3D,CAAA;AACH,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,KAA6B;IACvE,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACxF,OAAO;QACL,GAAG,KAAK;QACR,QAAQ;KACT,CAAA;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { MCPTool } from './proposals-tool.js';
2
+ export declare const resourcesTool: MCPTool;
3
+ //# sourceMappingURL=resources-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-tool.d.ts","sourceRoot":"","sources":["../src/resources-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,eAAO,MAAM,aAAa,EAAE,OA0E3B,CAAA"}
@@ -0,0 +1,76 @@
1
+ export const resourcesTool = {
2
+ name: 'resources',
3
+ description: 'Manage media resources: generate images, audio, and video via AI, save files from URLs, and browse existing resources. Generation operations auto-save to the resource library with thumbnails.',
4
+ parameters: {
5
+ type: 'object',
6
+ properties: {
7
+ operation: {
8
+ type: 'string',
9
+ enum: ['list', 'get', 'generate_image', 'generate_audio', 'generate_video', 'add_from_url'],
10
+ description: 'The resource operation to execute'
11
+ },
12
+ // READ params
13
+ query: {
14
+ type: 'string',
15
+ description: 'Search filter for list operation — matches name, description, or tags'
16
+ },
17
+ type_filter: {
18
+ type: 'string',
19
+ description: 'Filter by media type prefix for list operation (e.g. "image", "audio", "video")'
20
+ },
21
+ resource_id: {
22
+ type: 'string',
23
+ description: 'Resource ID for get operation (e.g. "res-1234567890-abc123def")'
24
+ },
25
+ // generate_image params
26
+ prompt: {
27
+ type: 'string',
28
+ description: 'Text prompt describing the image or video to generate'
29
+ },
30
+ model: {
31
+ type: 'string',
32
+ enum: ['nano-banana-pro', 'flux-2-dev', 'flux-2-pro', 'gpt-image-1.5'],
33
+ description: 'AI model for image generation. Default: nano-banana-pro. Use gpt-image-1.5 for transparent backgrounds.'
34
+ },
35
+ aspect_ratio: {
36
+ type: 'string',
37
+ description: 'Aspect ratio for image/video (e.g. "1:1", "16:9", "9:16", "4:3", "3:2"). Default: 16:9 for images, 16:9 for video.'
38
+ },
39
+ // generate_audio params
40
+ text: {
41
+ type: 'string',
42
+ description: 'Text to convert to speech for audio generation'
43
+ },
44
+ voice: {
45
+ type: 'string',
46
+ description: 'Voice ID for audio generation. Default: English_Trustworth_Man'
47
+ },
48
+ // generate_video params (prompt is reused)
49
+ duration: {
50
+ type: 'number',
51
+ description: 'Video duration in seconds, 5-16. Default: 8'
52
+ },
53
+ resolution: {
54
+ type: 'string',
55
+ description: 'Video resolution (480p, 720p, 1080p). Default: 720p'
56
+ },
57
+ // add_from_url params
58
+ url: {
59
+ type: 'string',
60
+ description: 'URL to download and save as a resource'
61
+ },
62
+ // Shared metadata
63
+ tags: {
64
+ type: 'string',
65
+ description: 'Comma-separated tags for the resource'
66
+ },
67
+ description: {
68
+ type: 'string',
69
+ description: 'Description of the resource'
70
+ }
71
+ },
72
+ required: ['operation'],
73
+ additionalProperties: false
74
+ }
75
+ };
76
+ //# sourceMappingURL=resources-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-tool.js","sourceRoot":"","sources":["../src/resources-tool.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAY;IACpC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,iMAAiM;IAC9M,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,CAAC;gBAC3F,WAAW,EAAE,mCAAmC;aACjD;YACD,cAAc;YACd,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uEAAuE;aACrF;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iFAAiF;aAC/F;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iEAAiE;aAC/E;YACD,wBAAwB;YACxB,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uDAAuD;aACrE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,CAAC;gBACtE,WAAW,EAAE,yGAAyG;aACvH;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oHAAoH;aAClI;YACD,wBAAwB;YACxB,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gDAAgD;aAC9D;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gEAAgE;aAC9E;YACD,2CAA2C;YAC3C,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6CAA6C;aAC3D;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qDAAqD;aACnE;YACD,sBAAsB;YACtB,GAAG,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wCAAwC;aACtD;YACD,kBAAkB;YAClB,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uCAAuC;aACrD;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6BAA6B;aAC3C;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;QACvB,oBAAoB,EAAE,KAAK;KAC5B;CACF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovelybunch/mcp",
3
- "version": "1.0.75-alpha.8",
3
+ "version": "1.0.75-alpha.9",
4
4
  "description": "MCP tools for Coconut",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -14,8 +14,8 @@
14
14
  "test:ui": "vitest --ui"
15
15
  },
16
16
  "dependencies": {
17
- "@lovelybunch/core": "^1.0.75-alpha.8",
18
- "@lovelybunch/types": "^1.0.75-alpha.8",
17
+ "@lovelybunch/core": "^1.0.75-alpha.9",
18
+ "@lovelybunch/types": "^1.0.75-alpha.9",
19
19
  "hono": "^4.0.0"
20
20
  },
21
21
  "devDependencies": {
package/src/index.ts CHANGED
@@ -15,4 +15,5 @@ export type {
15
15
  KnowledgeDocument,
16
16
  KnowledgeDocumentMetadata
17
17
  } from './knowledge-tool.js'
18
+ export { resourcesTool } from './resources-tool.js'
18
19
  export type { MCPTool, MCPToolCall } from './proposals-tool.js'
@@ -64,7 +64,7 @@ const metadataSchema = {
64
64
 
65
65
  export const knowledgeTool: MCPTool = {
66
66
  name: 'knowledge_documents',
67
- description: 'Manage knowledge base markdown documents stored in .nut/context/knowledge. IMPORTANT: When searching for documents by topic or keyword, always use the query parameter to filter results server-side. The returned count reflects filtered results.',
67
+ description: 'Manage knowledge base markdown documents stored in .nut/knowledge. IMPORTANT: When searching for documents by topic or keyword, always use the query parameter to filter results server-side. The returned count reflects filtered results.',
68
68
  parameters: {
69
69
  type: 'object',
70
70
  properties: {
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Tests for resources tool definition
3
+ */
4
+
5
+ import { describe, it, expect } from 'vitest';
6
+ import { resourcesTool } from './resources-tool.js';
7
+
8
+ describe('resourcesTool', () => {
9
+ it('should have correct name', () => {
10
+ expect(resourcesTool.name).toBe('resources');
11
+ });
12
+
13
+ it('should have a description', () => {
14
+ expect(resourcesTool.description).toBeTruthy();
15
+ expect(resourcesTool.description).toContain('resource');
16
+ });
17
+
18
+ it('should have correct parameter structure', () => {
19
+ expect(resourcesTool.parameters.type).toBe('object');
20
+ expect(resourcesTool.parameters.required).toContain('operation');
21
+ expect(resourcesTool.parameters.additionalProperties).toBe(false);
22
+ });
23
+
24
+ describe('operations', () => {
25
+ it('should include all six operations', () => {
26
+ const ops = resourcesTool.parameters.properties.operation.enum;
27
+ expect(ops).toContain('list');
28
+ expect(ops).toContain('get');
29
+ expect(ops).toContain('generate_image');
30
+ expect(ops).toContain('generate_audio');
31
+ expect(ops).toContain('generate_video');
32
+ expect(ops).toContain('add_from_url');
33
+ expect(ops).toHaveLength(6);
34
+ });
35
+ });
36
+
37
+ describe('READ parameters', () => {
38
+ it('should have query parameter for list filtering', () => {
39
+ expect(resourcesTool.parameters.properties.query).toBeDefined();
40
+ expect(resourcesTool.parameters.properties.query.type).toBe('string');
41
+ });
42
+
43
+ it('should have type_filter parameter', () => {
44
+ expect(resourcesTool.parameters.properties.type_filter).toBeDefined();
45
+ expect(resourcesTool.parameters.properties.type_filter.type).toBe('string');
46
+ });
47
+
48
+ it('should have resource_id parameter for get', () => {
49
+ expect(resourcesTool.parameters.properties.resource_id).toBeDefined();
50
+ expect(resourcesTool.parameters.properties.resource_id.type).toBe('string');
51
+ });
52
+ });
53
+
54
+ describe('generate_image parameters', () => {
55
+ it('should have prompt parameter', () => {
56
+ expect(resourcesTool.parameters.properties.prompt).toBeDefined();
57
+ expect(resourcesTool.parameters.properties.prompt.type).toBe('string');
58
+ });
59
+
60
+ it('should have model parameter with valid enum values', () => {
61
+ const modelParam = resourcesTool.parameters.properties.model;
62
+ expect(modelParam).toBeDefined();
63
+ expect(modelParam.type).toBe('string');
64
+ expect(modelParam.enum).toContain('nano-banana-pro');
65
+ expect(modelParam.enum).toContain('flux-2-dev');
66
+ expect(modelParam.enum).toContain('flux-2-pro');
67
+ expect(modelParam.enum).toContain('gpt-image-1.5');
68
+ });
69
+
70
+ it('should have aspect_ratio parameter', () => {
71
+ expect(resourcesTool.parameters.properties.aspect_ratio).toBeDefined();
72
+ expect(resourcesTool.parameters.properties.aspect_ratio.type).toBe('string');
73
+ });
74
+ });
75
+
76
+ describe('generate_audio parameters', () => {
77
+ it('should have text parameter', () => {
78
+ expect(resourcesTool.parameters.properties.text).toBeDefined();
79
+ expect(resourcesTool.parameters.properties.text.type).toBe('string');
80
+ });
81
+
82
+ it('should have voice parameter', () => {
83
+ expect(resourcesTool.parameters.properties.voice).toBeDefined();
84
+ expect(resourcesTool.parameters.properties.voice.type).toBe('string');
85
+ });
86
+ });
87
+
88
+ describe('generate_video parameters', () => {
89
+ it('should have duration parameter', () => {
90
+ expect(resourcesTool.parameters.properties.duration).toBeDefined();
91
+ expect(resourcesTool.parameters.properties.duration.type).toBe('number');
92
+ });
93
+
94
+ it('should have resolution parameter', () => {
95
+ expect(resourcesTool.parameters.properties.resolution).toBeDefined();
96
+ expect(resourcesTool.parameters.properties.resolution.type).toBe('string');
97
+ });
98
+ });
99
+
100
+ describe('add_from_url parameters', () => {
101
+ it('should have url parameter', () => {
102
+ expect(resourcesTool.parameters.properties.url).toBeDefined();
103
+ expect(resourcesTool.parameters.properties.url.type).toBe('string');
104
+ });
105
+ });
106
+
107
+ describe('shared metadata parameters', () => {
108
+ it('should have tags parameter', () => {
109
+ expect(resourcesTool.parameters.properties.tags).toBeDefined();
110
+ expect(resourcesTool.parameters.properties.tags.type).toBe('string');
111
+ });
112
+
113
+ it('should have description parameter', () => {
114
+ expect(resourcesTool.parameters.properties.description).toBeDefined();
115
+ expect(resourcesTool.parameters.properties.description.type).toBe('string');
116
+ });
117
+ });
118
+
119
+ describe('schema validation compatibility', () => {
120
+ it('should only require operation (all other params are optional)', () => {
121
+ expect(resourcesTool.parameters.required).toEqual(['operation']);
122
+ });
123
+
124
+ it('should disallow additional properties', () => {
125
+ expect(resourcesTool.parameters.additionalProperties).toBe(false);
126
+ });
127
+
128
+ it('should have descriptions for all parameters', () => {
129
+ const props = resourcesTool.parameters.properties;
130
+ for (const [key, value] of Object.entries(props)) {
131
+ if (key !== 'operation') {
132
+ expect((value as any).description, `${key} should have a description`).toBeTruthy();
133
+ }
134
+ }
135
+ });
136
+ });
137
+ });
@@ -0,0 +1,77 @@
1
+ import type { MCPTool } from './proposals-tool.js'
2
+
3
+ export const resourcesTool: MCPTool = {
4
+ name: 'resources',
5
+ description: 'Manage media resources: generate images, audio, and video via AI, save files from URLs, and browse existing resources. Generation operations auto-save to the resource library with thumbnails.',
6
+ parameters: {
7
+ type: 'object',
8
+ properties: {
9
+ operation: {
10
+ type: 'string',
11
+ enum: ['list', 'get', 'generate_image', 'generate_audio', 'generate_video', 'add_from_url'],
12
+ description: 'The resource operation to execute'
13
+ },
14
+ // READ params
15
+ query: {
16
+ type: 'string',
17
+ description: 'Search filter for list operation — matches name, description, or tags'
18
+ },
19
+ type_filter: {
20
+ type: 'string',
21
+ description: 'Filter by media type prefix for list operation (e.g. "image", "audio", "video")'
22
+ },
23
+ resource_id: {
24
+ type: 'string',
25
+ description: 'Resource ID for get operation (e.g. "res-1234567890-abc123def")'
26
+ },
27
+ // generate_image params
28
+ prompt: {
29
+ type: 'string',
30
+ description: 'Text prompt describing the image or video to generate'
31
+ },
32
+ model: {
33
+ type: 'string',
34
+ enum: ['nano-banana-pro', 'flux-2-dev', 'flux-2-pro', 'gpt-image-1.5'],
35
+ description: 'AI model for image generation. Default: nano-banana-pro. Use gpt-image-1.5 for transparent backgrounds.'
36
+ },
37
+ aspect_ratio: {
38
+ type: 'string',
39
+ description: 'Aspect ratio for image/video (e.g. "1:1", "16:9", "9:16", "4:3", "3:2"). Default: 16:9 for images, 16:9 for video.'
40
+ },
41
+ // generate_audio params
42
+ text: {
43
+ type: 'string',
44
+ description: 'Text to convert to speech for audio generation'
45
+ },
46
+ voice: {
47
+ type: 'string',
48
+ description: 'Voice ID for audio generation. Default: English_Trustworth_Man'
49
+ },
50
+ // generate_video params (prompt is reused)
51
+ duration: {
52
+ type: 'number',
53
+ description: 'Video duration in seconds, 5-16. Default: 8'
54
+ },
55
+ resolution: {
56
+ type: 'string',
57
+ description: 'Video resolution (480p, 720p, 1080p). Default: 720p'
58
+ },
59
+ // add_from_url params
60
+ url: {
61
+ type: 'string',
62
+ description: 'URL to download and save as a resource'
63
+ },
64
+ // Shared metadata
65
+ tags: {
66
+ type: 'string',
67
+ description: 'Comma-separated tags for the resource'
68
+ },
69
+ description: {
70
+ type: 'string',
71
+ description: 'Description of the resource'
72
+ }
73
+ },
74
+ required: ['operation'],
75
+ additionalProperties: false
76
+ }
77
+ }