Merge pull request #135 from cyhano/fix/screenshot-media-type

fix: use detected media type for screenshots instead of hard-coded image/png
This commit is contained in:
Zhang GH
2026-08-29 15:52:43 +08:00
committed by GitHub
3 changed files with 124 additions and 11 deletions
@@ -784,7 +784,11 @@ export function registerTools(deps: ToolDeps): () => void {
additionalProperties: false,
properties: {
attachmentId: { type: "string", required: true },
mediaType: { type: "string", required: true, const: "image/png" },
mediaType: {
type: "string",
required: true,
enum: ["image/png", "image/jpeg", "image/webp", "image/gif"],
},
bytes: { type: "integer", required: true },
width: { type: "integer", required: true },
height: { type: "integer", required: true },
@@ -854,7 +858,7 @@ export function registerTools(deps: ToolDeps): () => void {
? {
image: {
attachmentId: String(ref.attachmentId),
mediaType: "image/png" as const,
mediaType: ref.mediaType,
bytes: ref.bytes,
width: ref.width,
height: ref.height,