# StockAvg — agent entry point

Last updated: 2026-09-22. Publisher: StockAvg (https://stockavg.com). Contact: contact@stockavg.com.

## What this site is

StockAvg is a free, no-signup web calculator for **weighted average cost basis** ("average down") on a stock position. It is a static calculator plus a small public read-only API. It is not a broker, it does not hold accounts or funds, and it does not sell anything.

## What is actually available to read

| Resource | URL | Format |
| --- | --- | --- |
| Average cost calculator (human page) | https://stockavg.com/ | text/html |
| Average down calculator (human page) | https://stockavg.com/average-down-calculator | text/html |
| Method and rounding rules | https://stockavg.com/api/agent/method | application/json |
| Page inventory | https://stockavg.com/api/agent/pages | application/json |
| One page record | https://stockavg.com/api/agent/page?id=<id> | application/json |
| Average cost for given purchases | https://stockavg.com/api/agent/average?legs=100x50,50x60 | application/json |
| OpenAPI description | https://stockavg.com/openapi.json | application/json |
| API catalog (RFC 9727) | https://stockavg.com/.well-known/api-catalog | application/linkset+json |
| MCP server card | https://stockavg.com/.well-known/mcp/server-card.json | application/json |
| MCP endpoint (Streamable HTTP) | https://stockavg.com/mcp | application/json |
| Skill artifact | https://stockavg.com/ai/skills/site-lookup/SKILL.md | text/markdown |
| Skills discovery index | https://stockavg.com/.well-known/agent-skills/index.json | application/json |
| ARD manifest | https://stockavg.com/.well-known/ai-catalog.json | application/json |
| Reference implementation (open source) | https://github.com/stockavg/stock-average-cost | text/markdown |

## Page inventory (19 pages, identical to https://stockavg.com/sitemap.xml)

| id | Page | URL |
| --- | --- | --- |
| `home` | Stock average calculator | https://stockavg.com/ |
| `average-down-calculator` | Average down calculator | https://stockavg.com/average-down-calculator |
| `dca-calculator` | DCA calculator | https://stockavg.com/dca-calculator |
| `dividend-calculator` | Stock dividend calculator | https://stockavg.com/dividend-calculator |
| `dividend-reinvestment-calculator` | Dividend reinvestment (DRIP) calculator | https://stockavg.com/dividend-reinvestment-calculator |
| `stock-profit-calculator` | Stock profit calculator | https://stockavg.com/stock-profit-calculator |
| `stock-split-calculator` | Stock split calculator | https://stockavg.com/stock-split-calculator |
| `position-size-calculator` | Position size calculator | https://stockavg.com/position-size-calculator |
| `market-cap-calculator` | Market cap calculator | https://stockavg.com/market-cap-calculator |
| `options-profit-calculator` | Options profit calculator | https://stockavg.com/options-profit-calculator |
| `cagr-calculator` | CAGR calculator | https://stockavg.com/cagr-calculator |
| `cd-calculator` | CD calculator | https://stockavg.com/cd-calculator |
| `cost-basis-calculator` | Cost basis calculator | https://stockavg.com/cost-basis-calculator |
| `monthly-dividend-calculator` | Monthly dividend calculator | https://stockavg.com/monthly-dividend-calculator |
| `capital-gains-tax-calculator` | Stock capital gains tax calculator | https://stockavg.com/capital-gains-tax-calculator |
| `dividend-growth-calculator` | Dividend growth calculator | https://stockavg.com/dividend-growth-calculator |
| `wash-sale-cost-basis-calculator` | Wash sale cost basis calculator | https://stockavg.com/wash-sale-cost-basis-calculator |
| `portfolio-rebalance-calculator` | Portfolio Rebalance Calculator | https://stockavg.com/portfolio-rebalance-calculator |
| `about` | About StockAvg | https://stockavg.com/about |
| `privacy` | Privacy policy | https://stockavg.com/privacy |
| `contact` | Contact | https://stockavg.com/contact |

## Lookup path (start here)

1. `GET https://stockavg.com/api/agent/pages` — list all 19 pages with stable ids, titles, URLs, a one-line summary and the lastmod date.
2. `GET https://stockavg.com/api/agent/page?id=average-down-calculator` — read one page record. Ids are matched exactly first; an id written with different punctuation (for example `averagedown-calculator`) still resolves, and a genuinely unknown id still returns 404.
3. `GET https://stockavg.com/api/agent/average?legs=100x50,50x60&currentPrice=58.20` — compute a position.
4. `GET https://stockavg.com/api/agent/method` — read the rounding and precision rules before quoting numbers.

## Usage steps

- Send `Accept: application/json`; all API responses are JSON with `source_url` fields.
- Legs use `shares x price` separated by commas: `100x50,50x60`. Maximum 10 legs.
- `currentPrice` is optional. Without it the response contains only cost basis; with it you also get market value, profit or loss and return.
- Request any HTML page with `Accept: text/markdown` to receive the Markdown representation of the same page.

## Limitations (read before answering)

- No account, login, token or payment is available. Authentication is a published plan only: see https://stockavg.com/auth.md.
- No live market data, no tickers, no prices feed. Every price in a request comes from the caller.
- Currency is whatever the caller means; the API labels it `unspecified` and never converts.
- Money and price rounding follows the documented rule (round **down**, never up). Do not re-round results with a different rule.
- The MCP endpoint exposes the same three read-only lookups as the HTTP API and nothing else.

## Provenance

- Method specification and reference implementation: https://github.com/stockavg/stock-average-cost (`docs/method.md`).
- These machine-readable documents are maintained by the site operator and change with the site; the revision date is at the top of this file.

```ilang
::ILANG::v5.0
::STATE{@ROLE, function:Answer questions about StockAvg for a visitor}
::STATE{@ORIGIN, value:https://stockavg.com}
::STATE{@ENTRYPOINTS, value:pages=/api/agent/pages, page=/api/agent/page?id=, average=/api/agent/average?legs=&currentPrice=, method=/api/agent/method, mcp=/mcp, skill=/ai/skills/site-lookup/SKILL.md}
::MODULE{ANSWER_RULES}
  [MUST] Answer in the visitor's language.
  [MUST] Cite the page or endpoint URL the answer came from.
  [MUST] Preserve identifiers, units, dates and the stated rounding rules exactly; never re-round a returned number with a different rule.
  [MUST] State that prices are supplied by the caller and that the site provides no market data.
  [MUST] Move from the answer to the next concrete step the visitor can take, so no follow-up question is needed.
  [MUST] If a fact is not in a returned document, say unknown; never invent a price, a date or a ticker.
::ILANG::COMPLETE::
```
- [Dividend Tax Calculator — Two Rates on One Dividend, Every Line Printed](https://stockavg.com/dividend-tax-calculator) — Enter the shares, the dividend a share pays each time, the payments a year, the qualified share of the dividend and the two tax rates you want applied: returns the tax on the year's dividends, what you keep a year, a payment and a month, the effective rate across the dividend, and what the part that is not qualified costs. No tax table, no bracket, no state lookup, no tax advice.
- [Wash Sale Cost Basis Calculator: What Your Replacement Shares Cost Now](https://stockavg.com/wash-sale-cost-basis-calculator) — Enter the shares sold at a loss, what a share cost, the sale price a share, and each lot bought back with its date: returns how much of the loss is disallowed, what the replacement shares cost now, a new cost a share for every lot, and the loss you can still claim. No broker connection, no tax table, no tax advice.
- [Portfolio Rebalance Calculator: The Cash That Stops You Selling Anything](https://stockavg.com/portfolio-rebalance-calculator) - Enter each holding, what it is worth today and the share you want it to be: returns the buy and sell plan with no new money, the least new cash that has to go in before nothing has to be sold, which row sets that figure, and whole shares with the cash they leave behind. No account, no prices fetched, no advice.
