replace_image
Replace an image in a Word document by specifying its index and a new image file. Optionally set the new image dimensions.
Instructions
替换文档中指定索引的图片。 使用 get_images_info 工具可以查看所有图片的索引。
Args: file_path: 文档路径 image_index: 要替换的图片索引 (0-based) new_image_path: 新图片文件路径 width_inches: 新图片宽度 (英寸),不指定则使用原图片尺寸 height_inches: 新图片高度 (英寸)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>",
"image_index": "<image_index>",
"new_image_path": "<new_image_path>"
},
"name": "replace_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | ||
| image_index | Yes | ||
| width_inches | No | ||
| height_inches | No | ||
| new_image_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |