查找键
使用 lodash _.findKey 查找第一个匹配的键
查找第一个值满足谓词的键。
**亮点:**
- 使用 lodash `_.findKey`
- 支持属性、matchesProperty 或 matches 对象谓词
- 返回第一个匹配键或 null
**示例:**
- 对象:`{"a":{"active":false},"b":{"active":true}}`
- 谓词类型:`Property`
- 属性名:`active`
- 结果:`"b"`
API 文档
请求端点
POST /zh/api/tools/find-key
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| objectInput | textarea | 是 | 输入 JSON 对象 |
| predicateType | select | 否 | - |
| predicateProperty | text | 否 | 使用属性谓词时的真值属性名 |
| matchPath | text | 否 | matchesProperty 的属性路径 |
| matchValue | textarea | 否 | 用于匹配的 JSON 值 |
| matchObject | textarea | 否 | 用于匹配的 JSON 对象 |
响应格式
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}
文本:
文本
AI MCP 文档
将此工具添加到您的 MCP 服务器配置中:
{
"mcpServers": {
"elysiatools-find-key": {
"name": "find-key",
"description": "使用 lodash _.findKey 查找第一个匹配的键",
"baseUrl": "https://elysiatools.com/mcp/sse?toolId=find-key",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}
你可以串联多个工具,比如:`https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`,最多20个。
如果遇见问题,请联系我们:[email protected]