Calc Required Price
by ismec-agent-tools.ismec.workers.dev in Other
原価要素から総原価・必要売価・値上げ必要額を計算し、9つの原価要素のうち未入力の要素と確認質問を返す(判定は返さない)
https://ismec-agent-tools.ismec.workers.dev/v1/calc/required-price- Price
- $0.01
- per call in USDC
- Uptime
- 100%
- last 30 days
- Response time
- 327 ms
- 568 ms slowest 5%
- Last check
- Passed
- 3 h ago, next any minute now
Reliability
Status and outage history · Atom feed · Watch with other listings
How to call it
POST https://ismec-agent-tools.ismec.workers.dev/v1/calc/required-price
Each call costs $0.01 in USDC on Base Sepolia, paid with the request over x402.
Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.
Example request
From the listing.
POST https://ismec-agent-tools.ismec.workers.dev/v1/calc/required-price
content-type: application/json
{
"costs": {
"material": 120000,
"outsourcing": 30000,
"processing": {
"hourlyRate": 6000,
"hours": 8
},
"transport": 5000
},
"currentQuote": 250000,
"includedElements": [],
"targetGrossMarginRatio": 0.3
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
costs | object | Yes | 原価要素ごとの金額(円)。入力した要素は入力済みとして扱う(0円も入力済み) |
currentQuote | integer | No | 現在の見積額(円・整数) |
includedElements | array of string | No | 金額欄は別に持たないが、他の項目に含めて入力済みの要素 |
targetGrossMarginRatio | number | Yes | 目標粗利率 0以上0.95未満(小数第6位まで)。売価に対する比率 |
Example response
The provider's example. We can't check it without paying.
Example response, 79 lines
{
"assumptions": [
"粗利率は売価に対する比率((売価 − 総原価) ÷ 売価)",
"入力されていない原価要素は0円として合計している。実際に発生する要素があるかは missingElements の確認質問で確かめる",
"missingElements は入力との差分であり、原価に含めるべきかの評価ではない。含めるかどうかは利用者が決める",
"円未満は切り上げ。整数演算で計算し、浮動小数点の誤差を含まない"
],
"disclaimer": "本結果は入力値に基づく計算結果の提供であり、経営・融資・税務・会計・投資・申請等の判断や助言ではありません。可否・合否・推奨は返しません。判断の基準は利用者が定め、必要に応じて専門家に確認してください。",
"result": {
"costBreakdown": [
{
"amount": 120000,
"key": "material",
"label": "材料"
},
{
"amount": 48000,
"key": "processing",
"label": "加工"
},
{
"amount": 5000,
"key": "transport",
"label": "運搬"
},
{
"amount": 30000,
"key": "outsourcing",
"label": "外注"
}
],
"currentGrossMarginRatio": 0.188,
"currentQuote": 250000,
"missingElements": [
{
"key": "setup",
"label": "段取り",
"question": "治具の取り付けや試し加工の時間は入っていますか?",
"whyOftenMissed": "1回ごとの準備時間を加工時間に含めていない"
},
{
"key": "inspection",
"label": "検査",
"question": "寸法確認・外観検査の時間は入っていますか?",
"whyOftenMissed": "「ついで」にやる検査が0円になる"
},
{
"key": "packing",
"label": "梱包",
"question": "梱包の時間と資材の費用は入っていますか?",
"whyOftenMissed": "梱包材と作業時間の両方が漏れる"
},
{
"key": "drawing",
"label": "図面",
"question": "図面の作成・修正の時間は入っていますか?",
"whyOftenMissed": "図面起こし・確認の時間を見積に入れない"
},
{
"key": "tooling",
"label": "工具",
"question": "この案件のためだけに買う刃物・治具はありますか?",
"whyOftenMissed": "案件専用の刃物・治具の費用を固定費扱いにする"
}
],
"priceGap": 40000,
"requiredPrice": 290000,
"totalCost": 203000
},
"source": "https://ismec.jp/cost-management/",
"tool": "required_price",
"trace": [
"加工費 = 8時間 × 6000円 → 円未満切り上げ 48000",
"総原価 = 入力された原価要素の合計 = 203000",
"必要売価 = 総原価 ÷ (1 − 目標粗利率) = 203000 ÷ (1 − 0.3) → 円未満切り上げ 290000",
"値上げ必要額 = max(必要売価 − 現在の見積額, 0) = max(290000 − 250000, 0) = 40000",
"現在の見積額での粗利率 = (見積額 − 総原価) ÷ 見積額 = (250000 − 203000) ÷ 250000 = 0.188"
]
}Call it from code
The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.01.
curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://ismec-agent-tools.ismec.workers.dev/v1/calc/required-price' \
-H 'content-type: application/json' \
--data-raw '{"costs":{"material":120000,"outsourcing":30000,"processing":{"hourlyRate":6000,"hours":8},"transport":5000},"currentQuote":250000,"includedElements":[],"targetGrossMarginRatio":0.3}'
# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - -X POST 'https://ismec-agent-tools.ismec.workers.dev/v1/calc/required-price' \
-H 'content-type: application/json' \
--data-raw '{"costs":{"material":120000,"outsourcing":30000,"processing":{"hourlyRate":6000,"hours":8},"transport":5000},"currentQuote":250000,"includedElements":[],"targetGrossMarginRatio":0.3}' \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decodeJavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
// Pays at most $0.01 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.01" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.01 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fismec-agent-tools.ismec.workers.dev%2Fv1%2Fcalc%2Frequired-price&method=POST
const res = await pay("https://ismec-agent-tools.ismec.workers.dev/v1/calc/required-price", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"costs": {
"material": 120000,
"outsourcing": 30000,
"processing": {
"hourlyRate": 6000,
"hours": 8
},
"transport": 5000
},
"currentQuote": 250000,
"includedElements": [],
"targetGrossMarginRatio": 0.3
}),
});
console.log(res.status, await res.text());Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
# Pays at most $0.01 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.01"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))
with x402_requests(client) as session:
res = session.post(
"https://ismec-agent-tools.ismec.workers.dev/v1/calc/required-price",
json={
"costs": {
"material": 120000,
"outsourcing": 30000,
"processing": {
"hourlyRate": 6000,
"hours": 8,
},
"transport": 5000,
},
"currentQuote": 250000,
"includedElements": [],
"targetGrossMarginRatio": 0.3,
},
)
print(res.status_code, res.text)Security scan
No findings
We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 3 h ago | Passed | 402 | 315 ms | $0.01 |
| 8 h ago | Passed | 402 | 327 ms | $0.01 |
| 13 h ago | Passed | 402 | 290 ms | $0.01 |
| 19 h ago | Passed | 402 | 352 ms | $0.01 |
| 24 h ago | Passed | 402 | 568 ms | $0.01 |
Show 5 older checks
| 29 h ago | Passed | 402 | 364 ms | $0.01 |
| 33 h ago | Passed | 402 | 291 ms | $0.01 |
| 38 h ago | Passed | 402 | 287 ms | $0.01 |
| 43 h ago | Passed | 402 | 364 ms | $0.01 |
| 2 days ago | Passed | 402 | 452 ms | $0.01 |