本文へスキップ

API ドキュメント

根本的な事実から規則を判定する(推論つき)

montaye 独自の規則(公式文書から読み、文書に印刷された計算例と照合済み)を、指定したフィールドで判定します。us.resident_alien は us.citizen、us.lawful_permanent_resident、今年と前2年の米国滞在日数(IRS Pub 519 のグリーンカードテストと実質的滞在テスト)と us.closer_connection_exception(そのより密接な関係の例外)を読みます。この項目を指定しないときは法の基準が決めます:法が日数で線を引いた部分は日数のとおり(今年の滞在が 183 日以上なら成り立たない)、そうでなければ残りを誰も判断していないときに基準が定める状態(Form 8840 で主張していなければ成り立たない)で、推論はそれを読むステップに付きます。回答は真・偽・不明で、待っているフィールド、推論の各ステップ(算術は正確に計算、基準との差)、読み取った文書とページ、規則が人の判断に委ねる部分(数えない日、初年度の選択)を返します。送った内容は保存しません。規則の一覧は GET /v1/status にあります。フィールドは追加されるだけです。

REST: POST /v1/rules/evaluate MCP ツール: rule_evaluate API キーが必要
拒否コード
  • 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#"
}