| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- class OpenGoodsAuditTool:
- name = 'open_goods_audit'
- route_path = '/mcp/tools/openGoodsAudit'
- def __init__(self, api_client=None):
- self.api_client = api_client
- def metadata(self):
- return {
- 'name': self.name,
- 'description': (
- '使用场景:用户要打开一条商品的审核单时调用。'
- '必须使用待审核列表第一列的商品编号,或用户给出的商品编号。'
- '返回审核单、可选项和只看不提交的参考。'
- '禁止使用:在本工具里提交审核结果,不得改走后台商品审核页。'
- '参数只用于工具内部调用;最终回答只能展示中文业务名称。'
- ),
- 'input_schema': {
- 'type': 'object',
- 'properties': {
- 'goods_id': {
- 'type': 'integer',
- 'minimum': 1,
- 'description': '商品编号,来自待审核列表或用户给出的审核页编号。',
- },
- },
- 'required': ['goods_id'],
- 'additionalProperties': False,
- },
- }
- def call(self, goods_id, request_id='rq_open_goods_audit'):
- if self.api_client is None:
- raise RuntimeError('api client is required for open_goods_audit')
- if not isinstance(goods_id, int) or isinstance(goods_id, bool) or goods_id < 1:
- raise ValueError('goods_id is invalid')
- return self.api_client.call_tool(
- self.name, self.route_path, {'goods_id': goods_id}, request_id,
- )
|