# api_haystack_needs_optin

Check if an Algorand address needs to opt into an asset before swapping. Returns true if opt-in is needed, false otherwise. Always returns false for ALGO (ASA 0). Use before executing a swap to determine if wallet_optin_asset should be called first.

Agent View of the PolicyLayer registry record for `api_haystack_needs_optin`. HTML page: https://policylayer.com/tools/goplausible-algorand-mcp/api-haystack-needs-optin

## Facts

- Tool: `api_haystack_needs_optin`
- Server: Algorand MCP (`goplausible/algorand-mcp`) — https://policylayer.com/tools/goplausible-algorand-mcp.md
- Homepage: https://github.com/GoPlausible/algorand-mcp
- Risk category: Read (Low risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Allowed

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "api_haystack_needs_optin",
    "arguments": {}
  }
}
```

## Why api_haystack_needs_optin is rated Low

This is a read-only operation that queries blockchain state to determine if a prerequisite condition exists before a transaction. It retrieves information without modifying any data or executing operations. The tool is informational and intended to be used defensively before executing swaps, typical of Read category functions like get, check, or query.

From the tool's own definition: "Tool checks/retrieves whether an address needs opt-in (returns true/false) with no side effects. Description explicitly states it 'Check if' and 'Returns' status, indicating a query operation."

## Use case

AI agents call api_haystack_needs_optin to retrieve information from Algorand MCP without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Algorand MCP:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "api_haystack_needs_optin": {}
  }
}
```

## Other tools on Algorand MCP (176)

- `api_ultrade_market_cancel_order` — Destructive — https://policylayer.com/tools/goplausible-algorand-mcp/api-ultrade-market-cancel-order.md
- `api_ultrade_wallet_revoke_key` — Destructive — https://policylayer.com/tools/goplausible-algorand-mcp/api-ultrade-wallet-revoke-key.md
- `make_app_delete_txn` — Destructive — https://policylayer.com/tools/goplausible-algorand-mcp/make-app-delete-txn.md
- `make_asset_destroy_txn` — Destructive — https://policylayer.com/tools/goplausible-algorand-mcp/make-asset-destroy-txn.md
- `wallet_remove_account` — Destructive — https://policylayer.com/tools/goplausible-algorand-mcp/wallet-remove-account.md
- `api_ultrade_wallet_signin` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/api-ultrade-wallet-signin.md
- `assign_group_id` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/assign-group-id.md
- `compile_teal` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/compile-teal.md
- `encode_unsigned_transaction` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/encode-unsigned-transaction.md
- `make_app_call_txn` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/make-app-call-txn.md
- `make_app_clear_txn` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/make-app-clear-txn.md
- `make_app_create_txn` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/make-app-create-txn.md
- `mnemonic_from_seed` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/mnemonic-from-seed.md
- `rekey_account` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/rekey-account.md
- `send_raw_transaction` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/send-raw-transaction.md
- `sign_bytes` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/sign-bytes.md
- `sign_transaction` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/sign-transaction.md
- `simulate_raw_transactions` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/simulate-raw-transactions.md
- `simulate_transactions` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/simulate-transactions.md
- `wallet_sign_data` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/wallet-sign-data.md
- `wallet_sign_transaction` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/wallet-sign-transaction.md
- `wallet_sign_transaction_group` — Execute — https://policylayer.com/tools/goplausible-algorand-mcp/wallet-sign-transaction-group.md
- `alpha_amend_order` — Financial — https://policylayer.com/tools/goplausible-algorand-mcp/alpha-amend-order.md
- `alpha_cancel_order` — Financial — https://policylayer.com/tools/goplausible-algorand-mcp/alpha-cancel-order.md
- `alpha_claim` — Financial — https://policylayer.com/tools/goplausible-algorand-mcp/alpha-claim.md
- `alpha_create_limit_order` — Financial — https://policylayer.com/tools/goplausible-algorand-mcp/alpha-create-limit-order.md
- `alpha_create_market_order` — Financial — https://policylayer.com/tools/goplausible-algorand-mcp/alpha-create-market-order.md
- `alpha_merge_shares` — Financial — https://policylayer.com/tools/goplausible-algorand-mcp/alpha-merge-shares.md
- `alpha_propose_match` — Financial — https://policylayer.com/tools/goplausible-algorand-mcp/alpha-propose-match.md
- `alpha_split_shares` — Financial — https://policylayer.com/tools/goplausible-algorand-mcp/alpha-split-shares.md
- …and 146 more: https://policylayer.com/tools/goplausible-algorand-mcp.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=goplausible-algorand-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/goplausible-algorand-mcp
