API 文档
由根部事实判一条规则,带推理链
montaye 自己的一条规则(读自官方文件,并对过文件里印的算例),按你给的字段来判:us.resident_alien 读 us.citizen、us.lawful_permanent_resident、今年、去年、前年在美国的天数(IRS Pub 519 的绿卡测试和实质居住测试)和 us.closer_connection_exception(它的更紧密联系例外)。这一项不给时,由一个法律标准来定:法律按天数划了线、天数就能定的,照天数(今年在美国 183 天或以上,就不成立);否则照标准说的、其余各项没人判断时的样子(没用 Form 8840 主张,就不成立),推理挂在读它的那一步上。回答是真、假或不知道,带上还缺的字段、推理的每一步(算术精确地算、离线还差多少)、读自哪份文件哪一页,以及规则留给人判断的部分(不算的天数、第一年的选择)。你发来的不存。规则列在 GET /v1/status。字段只增不减。
REST: POST /v1/rules/evaluate MCP 工具: rule_evaluate 需要 API key
拒绝码
- input_invalid (400) The request does not match the action’s input schema.
- not_found (404) No such action or document.
- rule_not_in_force (422) The rule montaye publishes by that code states the law of other days: no revision of it is in force on the day asked.
- key_missing (401) This action needs an API key (Authorization: Bearer <key>).
- key_invalid (401) The API key is unknown, revoked or expired.
- rate_limited (429) Too many requests from this client; slow down.
- plan_excludes_action (403) The account’s plan does not include this action.
输入(JSON Schema)
{
"type": "object",
"properties": {
"code": {
"type": "string",
"pattern": "^[a-z0-9_.-]+$"
},
"on": {
"type": "string",
"format": "date"
},
"fields": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[a-z0-9_.]+$"
},
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "object",
"properties": {
"from": {
"type": "string",
"format": "date"
},
"until": {
"anyOf": [
{
"type": "string",
"format": "date"
},
{
"type": "null"
}
]
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "boolean"
}
]
}
},
"required": [
"from",
"until",
"value"
]
}
}
]
}
}
},
"required": [
"code",
"fields"
],
"$schema": "http://json-schema.org/draft-07/schema#"
}