Document Tools
从Word文档中提取文本内容,支持格式选项、段落选择和多语言处理
用三种语言从你的代码中调用此工具。
# 1) Upload each file first → returns { filePath }
curl -X POST 'https://api.elysiatools.com/upload/word-text-extractor' \
-F 'file=@/path/to/wordFile.ext'
# 2) Call the tool with the returned filePath values
curl -X POST 'https://api.elysiatools.com/zh/api/tools/word-text-extractor' \
-F 'wordFile=/path/to/file.ext' \
-F 'paragraphRange=例如:1-10 或 5 或 1,3,5' \
-F 'outputFormat=plain' \
-F 'preserveFormatting=true' \
-F 'removeExtraWhitespace=false' \
-F 'includeLineNumbers=false' \
-F 'encoding=utf-8'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/word-text-extractor| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| wordFile | file需先上传 | 是 | 支持最大50MB的Word文档(.docx, .doc) |
| paragraphRange | text | 否 | 指定要提取的段落(1-10为范围,5为单段落,1,3,5为多段落)。留空则提取所有段落。 |
| outputFormat | select | 否 | — |
| preserveFormatting | checkbox | 否 | 尽可能保持原始布局、间距和格式 |
| removeExtraWhitespace | checkbox | 否 |
将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-word-text-extractor": {
"name": "word-text-extractor",
"description": "从Word文档中提取文本内容,支持格式选项、段落选择和多语言处理",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=word-text-extractor",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}连接到 SSE 端点后,列出已开放的工具:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}通过工具 id 调用,参数由其参数表构建:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "word-text-extractor",
"arguments": {
"wordFile": "https://example.com/file.ext",
"paragraphRange": "例如:1-10 或 5 或 1,3,5",
"outputFormat": "plain",
"preserveFormatting": true,
"removeExtraWhitespace": false,
"includeLineNumbers": false,
"encoding": "utf-8"
}
}
}| 清理多余的空格和换行符 |
| includeLineNumbers | checkbox | 否 | 为提取的文本添加行号 |
| encoding | select | 否 | — |
文本结果
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}有问题或反馈?请联系 [email protected]