How the Rules system works
A practical and technical guide for clients, architects, developers and AI agents. It explains the public search, what a rule means, what the database does and does not contain, how verified AI checks work, and how to use the REST API and MCP without letting a language model invent regulatory facts.
1. What this system is — and what it is not
VPAA Rules is a structured layer above the full text of Serbian building and planning regulations and selected planning documents. Instead of asking a person or an AI model to read thousands of articles from scratch for every question, the database extracts requirements that can actually be checked on a project: measurable limits, clear obligations, applicability conditions, traps and exact source quotations.
A rule is useful only when it remains traceable to its source. For that reason a usable record contains the regulation or plan, official gazette, article, literal quotation, a human-readable question and answer, and—where possible—a structured machine check.
It is
A fast way to locate project-relevant requirements, verify the source, filter by applicability and let software evaluate only deterministic checks.
It is not
A replacement for the official gazette, location conditions, a competent authority, a responsible designer, legal advice or a formal approval of the project.
2. Three ways to use the system
1 · Human search
Use /pravila in a browser. Best for exploration, source verification, filters and reading exact quotations.
2 · REST API
Use structured JSON from your own application, backend, chatbot or workflow. Search, check and audit are separate endpoints.
3 · MCP
Connect Claude or another MCP-capable agent directly to VPAA Rules tools. The agent understands the client; the server remains the source of regulatory facts.
Recommended combination
Use the public page to inspect and verify. Use REST/MCP when software must ask follow-up questions, compare measurements or run a pre-submission audit.
Parcel / Plan Context
Plan Context is the planning layer in front of the general Rules engine. Open /provjeri-parcelu/ and identify a Belgrade location either by cadastral municipality + parcel number or by a WGS84 point / map click. The service queries public Beoland GIS layers, then tries to connect the returned zone to a locally verified planning record with an official-gazette reference and literal quotation.
The result deliberately separates informational GIS context from verified planning parameters. A GIS number is useful for discovery, but it is not promoted to a legal planning threshold unless the response says can_conclude_legal_parameters=true.
Hierarchy and ambiguous boundaries
Hierarchy
PDR / specific plan > PGR > general rules. If a lower-order/specific plan is detected, PGR remains useful context but is not returned as the final project parameter.
ambiguous
If a point intersects materially different plan/zone records, the server does not choose the first feature. It returns an ambiguous status and requires manual boundary verification.
Indicative development potential
When parcel area and usable coverage/FAR values are available, the page may show quick footprint and gross-floor-area arithmetic. GIS-only inputs are marked indicative_from_gis and can_use_as_legal_parameter=false. Setbacks, height, green area, parking, access, heritage, infrastructure and other constraints may reduce achievable GFA.
REST API
POST /api/v2/rules/plan-context/
Content-Type: application/json
{"parcel":{"cadastral_municipality":"Zemun","number":"1234/5"}}
// or: {"lat":44.8125,"lon":20.4612}Read coverage, resolution.status, resolution.hierarchy, can_conclude_legal_parameters, plan, zone, parameters.verified, parameters.informational_gis, development_potential, risks, sources and warnings.
MCP · get_plan_context
An MCP agent should call get_plan_context before parcel-specific Belgrade planning answers when the parcel or coordinate is known. It must not convert GIS-only values into legal facts from model memory. Ambiguous boundaries or a controlling PDR/specific plan require explanation/manual verification instead of falling back to PGR.
3. How the public search works
The search box is intentionally not a general-purpose chatbot. It searches the structured rule corpus. Serbian Latin, Serbian Cyrillic and diacritics are normalized so the same concept can match across scripts. Common question/helper words and very short words are removed, while longer words are reduced to rough stems so case endings do not unnecessarily kill a match.
The remaining word roots are combined conservatively: all of them should match somewhere in a rule. If that gives zero results, the engine gradually removes the rarest blocking term until it finds the broadest useful core. It deliberately does not switch to a huge “match any word” result set, because a noisy list is dangerous in a regulatory context.
Filters
- Area / oblast: narrows the subject area.
- blokira / proveriti / informativno: severity/use category.
- potvrđeno / izvedeno: verification status. Revision rules are hidden from public visitors.
4. How to ask the best question
For an AI agent, natural language is welcome—but the facts must be explicit. A strong question tells the agent what the project is, where it is, what condition is being checked, and the actual measured value with its unit. Do not force the client to know database field names; the agent should map ordinary language to the current schema exposed by the server.
Weak
“Is my project OK?”
No location, use, project facts or measurable issue.
Better
“Residential house in Belgrade with an underground garage. The clear ramp width is 270 cm. Is it sufficient and what else is missing for this check?”
Rejected measurement
“ramp width = 270”
The server cannot safely guess whether this means mm, cm or m.
Safe measurement
“ramp width = 270 cm”
The server can deterministically convert compatible units before comparison.
A useful question template
Project: [house / apartment building / hotel / commercial / mixed use] Location: [city + plan/zone if known] Stage: [before location conditions / PGD / works / technical inspection] Relevant facts: [garage, number of dwellings, building position, protected area...] Measurement: [value + unit] Question: [one concrete regulatory check] Then: tell me what information is missing and cite every rule you rely on.
Compound questions are allowed, but a good AI agent should decompose them into separate canonical checks instead of sending one vague mega-query.
5. How to read a rule card
| Field | Meaning |
|---|---|
| Question | Human formulation of what is being checked. |
| Value / answer | Condensed requirement extracted from the source. |
| Applicability | Conditions that must be true before the rule can be applied to this project. |
| Trap | A frequent mistake, exception or practical reason a project can still fail. |
| Source | Regulation/plan, article and official gazette. |
| Literal quote | Exact source text used to support the extracted rule. |
| potvrđeno | Manually verified / verified on a concrete case. Eligible for AI regulatory conclusions. |
| izvedeno | Extracted from the text and checked against its quotation, but not yet promoted to verified status for client-facing AI conclusions. |
| blokira | A requirement treated as potentially blocking the submission/approval if not satisfied. |
| proveriti | A requirement that should be checked and may require correction or additional evidence. |
| informativno | Context, definition or procedure that helps explain applicability but is not itself a drawing measurement. |
6. Coverage: what is in the database and what is planned
The rule database is intentionally transparent about incompleteness. A regulation can be in the full-text corpus and registry before any structured rule has been extracted from it. Not every article becomes a rule: definitions, transitional provisions and purely procedural text may be read and deliberately skipped, while measurable requirements and clear project obligations are extracted with a literal quote.
Planning documents are tracked separately from national regulations. They matter because a specific plan can override a general rule for a location; therefore plan-specific rules must never be applied without the relevant location/zone context.
Sources already producing structured rules
| Regulation / source | Gazette | Articles | Processed | Rules |
|---|---|---|---|---|
| Zakon o planiranju i izgradnji | Sl. glasnik RS, br. 72/2009 … 62/2023 i 91/2025 | 243 | 243 | 216 |
| Pravilnik o tehničkim standardima planiranja, projektovanja i izgradnje objekata, kojima se osigurava nesmetano kretanje i pristup osobama sa invaliditetom, deci i starim osobama | Sl. glasnik RS, br. 22/2015 i 10/2026 | 47 | 47 | 139 |
| Pravilnik o sadržini, načinu i postupku izrade i načinu vršenja kontrole tehničke dokumentacije prema klasi i nameni objekata | Sl. glasnik RS, br. 96/2023 | 90 | 90 | 127 |
| Pravilnik o tehničkim normativima za zaštitu od požara stambenih i poslovnih objekata i objekata javne namene | Sl. glasnik RS, br. 22/2019 | 59 | 59 | 102 |
| Pravilnik o postupku sprovođenja objedinjene procedure elektronskim putem | Sl. glasnik RS, br. 96/2023 i 33/2026 | 65 | 65 | 99 |
| Pravilnik o opštim pravilima za parcelaciju, regulaciju i izgradnju | Sl. glasnik RS, br. 22/2015 | 67 | 67 | 84 |
| Pravilnik o tehničkim zahtevima za zaštitu garaža za putničke automobile od požara i eksplozija | Sl. list SCG, br. 31/2005 | 42 | 42 | 78 |
| Pravilnik o uslovima i normativima za projektovanje stambenih zgrada i stanova | Sl. glasnik RS, br. 58/2012, 74/2015 i 82/2015 | 51 | 51 | 66 |
| Zakon o vodama | Sl. glasnik RS, br. 30/2010, 93/2012, 101/2016, 95/2018 i 95/2018 - dr. zakon | 203 | 3 | 56 |
| Uredba o lokacijskim uslovima | Sl. glasnik RS, br. 87/2023 | 42 | 42 | 54 |
| Pravilnik o tehničkim zahtevima bezbednosti od požara spoljnih zidova zgrada | Sl. glasnik RS, br. 59/2016, 36/2017 i 6/2019 | 20 | 20 | 52 |
| Zakon o putevima | Sl. glasnik RS, br. 41/2018, 95/2018 - dr. zakon i 92/2023 - dr. zakon | 110 | 11 | 37 |
| Zakon o zaštiti od požara | Sl. glasnik RS, br. 111/2009, 20/2015, 87/2018 i 87/2018 - dr. zakoni | 66 | 15 | 37 |
| Zakon o stanovanju i održavanju zgrada | Sl. glasnik RS, br. 104/2016 i 9/2020 - dr. zakon | 157 | 13 | 33 |
| Zakon o posebnim uslovima za evidentiranje i upis prava na nepokretnostima | Sl. glasnik RS, br. 91/2025 i 80/2026 | — | 14 | 31 |
| Pravilnik o tehničkim normativima za zaštitu visokih objekata od požara | Sl. glasnik RS, br. 80/2015, 67/2017 i 103/2018 | 79 | 16 | 26 |
| Zakon o opštem upravnom postupku (ZUP) | Sl. glasnik RS, br. 18/2016, 95/2018 – autentično tumačenje i 2/2023 – odluka US | 216 | 15 | 21 |
| Pravilnik o energetskoj efikasnosti zgrada | Sl. glasnik RS, br. 61/2011 | 25 | 25 | 19 |
| Pravilnik o uslovima, sadržini i načinu izdavanja sertifikata o energetskim svojstvima zgrada | Sl. glasnik RS, br. 69/2012, 44/2018 – dr. zakon, 111/2022 i 102/2025 | 22 | 22 | 18 |
| Pravilnik za građevinske konstrukcije | Sl. glasnik RS, br. 89/2019, 52/2020 i 122/2020 | 100 | 17 | 18 |
| Pravilnik o sadržini i načinu vođenja knjige inspekcije, građevinskog dnevnika i građevinske knjige | Sl. glasnik RS, br. 96/2023 | 20 | 20 | 18 |
| Pravilnik o standardima za kategorizaciju ugostiteljskih objekata za smeštaj | Sl. glasnik RS, br. 83/2016 i 30/2017 | 36 | 6 | 18 |
| Uredba o listi projekata za procenu uticaja na životnu sredinu | Sl. glasnik RS, br. 106/2025 | — | 19 | 18 |
| Pravilnik o tehničkim normativima za skloništa | Sl. list SFRJ, br. 55/1983 | 238 | 8 | 14 |
| Pravilnik o uslovima i načinu obavljanja ugostiteljske delatnosti, razvrstavanju i minimalno tehničkim uslovima | Sl. glasnik RS, br. 48/2012 i 58/2016 | — | 11 | 13 |
| Uredba o bezbednosti i zdravlju na radu na privremenim ili pokretnim gradilištima | Sl. glasnik RS, br. 14/2009, 95/2010, 98/2018, 35/2023 - dr. zakon i 76/2024 | — | 5 | 12 |
| Zakon o kulturnom nasleđu | Sl. glasnik RS, br. 129/2021 | 135 | 15 | 12 |
| Zakon o proceni uticaja na životnu sredinu | Sl. glasnik RS, br. 94/2024; objavljeno 28.11.2024; na snazi od 06.12.2024 | 64 | 9 | 12 |
| Zakon o kulturnim dobrima — odredbe koje ostaju na snazi po čl. 137 Zakona o kulturnom nasleđu | Sl. glasnik RS, br. 71/94, 52/11 – dr. zakoni, 99/11 – dr. zakon, 6/20 – dr. zakon i 35/21 – dr. zakon | 135 | 15 | 11 |
| Zakon o planiranju i izgradnji — izmene i dopune 80/2026 | Sl. glasnik RS, br. 80/2026; objavljeno 31.08.2026; u primeni od 01.09.2026 | — | 5 | 10 |
| Zakon o ugostiteljstvu | Sl. glasnik RS, br. 17/2019 | 102 | 5 | 9 |
| Pravilnik o klasifikaciji objekata | Sl. glasnik RS, br. 22/2015 | 8 | 8 | 7 |
| Zakon o planiranju i izgradnji | važeći prečišćeni tekst u bazi | 243 | 243 | 6 |
| Zakon o smanjenju rizika od katastrofa i upravljanju vanrednim situacijama | Sl. glasnik RS, br. 87/2018 | — | 1 | 4 |
| Uredba o listi projekata za procenu uticaja na životnu sredinu | Sl. glasnik RS, br. 106/2025; objavljeno 28.11.2025; na snazi od 06.12.2025 | — | 19 | 2 |
| Zakon o planiranju i izgradnji | Sl. glasnik RS, br. 72/2009 ... 62/2023 i 91/2025 | 243 | 243 | 2 |
| Pravilnik o građevinskim konstrukcijama | Sl. glasnik RS, br. 89/2019 i 52/2020 | 100 | 17 | 1 |
| Pravilnik o tehnickim normativima za instalacije hidrantske mreze za gasenje pozara | Sl. glasnik RS, br. 3/2018 | 41 | 1 | 1 |
| Pravilnik o opstim pravilima za parcelaciju, regulaciju i izgradnju | Sl. glasnik RS, br. 22/2015 | 67 | 67 | 1 |
| Pravilnik o postupku sprovodjenja objedinjene procedure elektronskim putem | Sl. glasnik RS, br. 96/2023 i 33/2026 | 65 | 65 | 1 |
| Pravilnik o tehnickim normativima za zastitu od pozara stambenih i poslovnih objekata i objekata javne namene | Sl. glasnik RS, br. 22/2019 | 59 | 59 | 1 |
| Zakon o bezbednosti i zdravlju na radu | Sl. glasnik RS, br. 35/2023 | 113 | 1 | 1 |
| Zakon o planiranju i izgradnji | Sl. glasnik RS, br. 72/2009 ... 91/2025 i 80/2026 | 243 | 243 | 1 |
| Zakon o planiranju i izgradnji + Pravilnik o tehničkoj dokumentaciji | ZPI: Sl. glasnik RS ... 62/2023 i 91/2025; Pravilnik: 96/2023 | 243 | 243 | 1 |
| Zakon o planiranju i izgradnji; Pravilnik o posebnoj vrsti objekata i posebnoj vrsti radova za koje nije potrebno pribavljati akt nadleznog organa... | ZPI — poslednje izmene 80/2026; Pravilnik — Sl. glasnik RS, br. 87/2023, 16/2024 i 16/2026 | 243 | 243 | 1 |
| Zakon o planiranju i izgradnji; Zakon o opstem upravnom postupku | ZPI: poslednje izmene 80/2026; ZUP: 18/2016, 95/2018 i 2/2023 | 243 | 243 | 1 |
| Zakon o stanovanju i odrzavanju zgrada | Sl. glasnik RS, br. 104/2016 i 9/2020 - dr. zakon | 157 | 13 | 1 |
| Plan generalne regulacije građevinskog područja sedišta jedinice lokalne samouprave – grad Beograd (celine I–XIX) plan | Sl. list grada Beograda, br. 20/2016 … 36/2026 | — | — | 8 |
| Pravilnik o posebnoj vrsti objekata i posebnoj vrsti radova za koje nije potrebno pribavljati akt nadleznog organa... plan | Sl. glasnik RS, br. 87/2023, 16/2024 i 16/2026 | — | — | 3 |
| Zakon o posebnim uslovima za evidentiranje i upis prava na nepokretnostima; Zakon o planiranju i izgradnji plan | Sl. glasnik RS, br. 91/2025 i 80/2026; ZPI poslednje izmene 80/2026 | — | — | 1 |
Registry backlog — present in the corpus, not yet converted into rules
This live list is the clearest current roadmap of regulations waiting for structured extraction. It changes automatically as sources are processed.
- Zakon o državnom premeru i katastru (159 articles)
- Zakon o ozakonjenju objekata (47 articles)
7. The core AI principle: language model for language, rule engine for facts
Applicability is three-state: true, false or unknown. Unknown is not “probably yes”; it means the agent lacks a project fact required to decide whether the rule applies.
8. REST API
The discovery endpoint is the starting point for every robust client. Do not hard-code the profile fields or measurement metric names in an AI application: read the schema exposed by the deployed corpus.
| Endpoint | Method | Use |
|---|---|---|
/api/v2/rules/ | GET | Discovery: version, corpus stats, policy, concepts, profile schema, measurement schema. |
/api/v2/rules/query/ | POST JSON | Focused verified search. |
/api/v2/rules/check/ | POST JSON | Selected checks for a concrete project and measurements. |
/api/v2/rules/audit/ | POST JSON | Broad pre-submission audit against currently verified coverage. |
Discovery
curl -sS https://vladimirperovic.com/api/v2/rules/
Focused rule search
curl -sS https://vladimirperovic.com/api/v2/rules/query/ \
-H 'Content-Type: application/json' \
-d '{
"question": "Kolika je svetla visina garaže?",
"concepts": ["garage_clear_height"],
"profile": {"grad": "Beograd"}
}'Concrete measurement check
curl -sS https://vladimirperovic.com/api/v2/rules/check/ \
-H 'Content-Type: application/json' \
-d '{
"question": "Da li mi je garažna rampa dovoljno široka?",
"checks": ["garage_ramp_width"],
"profile": {"garaza_u_objektu": true},
"measurements": {
"cista_sirina_rampe": {"value": 270, "unit": "cm"}
}
}'The metric name above is an example from the current corpus. Production clients should discover the live measurement schema rather than assuming that field name forever.
Broad audit
curl -sS https://vladimirperovic.com/api/v2/rules/audit/ \
-H 'Content-Type: application/json' \
-d '{
"profile": {
"grad": "Beograd",
"namena": "stanovanje"
},
"measurements": {}
}'Request rules
- POST endpoints require Content-Type: application/json.
- JSON body limit is 128 KiB.
- Unknown profile keys and measurement metrics are rejected rather than silently ignored.
- Numeric measurements require both value and unit.
- Compatible units are normalized deterministically before comparison.
- If VPAA_RULES_API_KEY is configured on the server, add Authorization: Bearer
.
9. MCP: connecting Claude or another AI agent
The remote MCP endpoint is:
https://vladimirperovic.com/mcp/
The server exposes three main tools:
search_rules— find verified rules relevant to a focused question.check_project— evaluate selected checks against explicit project facts and measurements.audit_project— run a broader pre-submission scan across current verified coverage.
Generic setup
- In your MCP-capable client, add a remote HTTP MCP server pointing to the URL above.
- If the server is in private API-key mode, configure the Bearer Authorization header if the client supports custom headers.
- Verify that the client can list the tools. The agent should inspect the current tool schema rather than assume old field names.
- Give the agent the behavioral instructions in the next section.
Illustrative client concept (exact configuration keys depend on the MCP client): name: vpaa-rules transport: remote HTTP url: https://vladimirperovic.com/mcp/
Protocol compatibility details
The current implementation supports the modern stateless MCP lifecycle used by protocol 2026-07-28, including server discovery, per-request protocol version and routing validation. Legacy initialize-era clients for 2025-11-25, 2025-06-18 and 2025-03-26 remain supported. Modern requests should not use the old lifecycle.
The MCP endpoint validates Origin to reduce browser/DNS-rebinding risk. The normal allowed browser origins are the vladimirperovic.com hosts; server deployment can override the allow-list through VPAA_MCP_ALLOWED_ORIGINS.
10. Recommended instructions for an AI agent
This is the important part. Connecting the MCP server is not enough; the agent must know how to behave when regulatory information is incomplete.
You are using VPAA Rules as the source of regulatory facts for Serbian building/project questions. 1. Never provide a legal/regulatory threshold from model memory. 2. Read the currently exposed VPAA tool/schema before mapping fields. 3. Decompose compound client questions into focused checks. 4. Extract only facts the client explicitly stated or that are reliably available from project data. 5. Never invent a profile fact just to make a rule applicable. 6. Preserve every measurement with its explicit unit. If the unit is unknown, ask for it. 7. Use search_rules to retrieve relevant verified rules, check_project for concrete checks, and audit_project for broader pre-submission review. 8. Treat applicability=unknown as missing information, not as true. 9. Explain only verified findings returned by VPAA Rules. Cite the regulation, article and source supplied by the tool. 10. If missing_information is returned, ask the client for those facts before making the affected conclusion. 11. If coverage says unverified_match_only or no_verified_answer, state clearly that the verified database is not sufficient for that conclusion. 12. Never convert no_detected_issue into “the project is approved/compliant”. It only means no issue was detected within the verified checks that could actually be evaluated. 13. If a relevant local plan/location condition may override a general rule and the location context is missing, ask for the plan/zone/location conditions. 14. Keep the client-facing answer in normal language. Do not dump raw JSON unless requested.
11. How to interpret AI results
| Result field/status | Meaning |
|---|---|
applicable_rules | Verified rules whose applicability is established from the supplied project facts. These may support a regulatory statement. |
possible_rules | Verified rules that may apply, but a required project fact is missing. They are not yet a conclusion. |
missing_information | Facts the agent should ask for next. |
coverage=unverified_match_only | The corpus found relevant material, but it is not verified enough for a client-facing AI conclusion. |
coverage=no_verified_answer | No verified answer is currently available for the requested conclusion. |
needs_attention | At least one deterministic check failed. |
incomplete | The audit lacks facts/measurements, has unresolved possible rules, invalid inputs, or unresolved truncated output. |
manual_review_required | No deterministic failure, but one or more applicable rules require human/project review rather than a numeric comparison. |
no_detected_issue | No issue was detected in the verified rules that could actually be evaluated. This is not formal approval. |
rule_only | The rule is relevant but cannot be reduced to a deterministic machine pass/fail; human review is still required. |
12. Common errors and troubleshooting
400 · invalid_json / invalid_json_object
The body is not valid JSON or the top level is not a JSON object.
401 · unauthorized
Private API-key mode is enabled and the Bearer token is missing or wrong.
413 · payload_too_large
The JSON body exceeded the 128 KiB limit. Send only facts relevant to the requested checks.
415 · unsupported_media_type
Use Content-Type: application/json for POST requests.
422 · invalid_request
Typical causes are an unknown profile field, unknown metric, invalid enum value, incompatible/missing unit or another schema violation. Read discovery/tools/list and retry with the current schema.
429 · rate_limited
Back off and respect Retry-After. The public browser search and AI API are rate-limited to protect the read-only database service.
The browser found a rule but the AI says it has no verified answer
This can be correct. The public page also shows derived rules; the AI conclusion path uses verified rules only.
A relevant rule is returned under possible_rules
Do not force it into applicable_rules. Ask for the missing project facts reported by the engine.
13. Security, data integrity and limitations
- The website opens the rules database read-only. Production web requests do not write regulatory data into SQLite.
- Rules marked for revision are excluded from the public AI engine. They cannot be re-enabled by an agent parameter.
- AI conclusions are verified-only by design.
- Every usable rule remains traceable to regulation/plan, gazette, article and literal quote.
- Unknown applicability stays unknown. Missing units or incompatible units fail closed.
- REST and MCP are rate-limited; REST can optionally be protected by VPAA_RULES_API_KEY.
- MCP validates Origin and supports an explicit allow-list for browser origins.
Practical CEOP and project-procedure guides
The practical library explains the typical path from parcel and planning document through location conditions, design documentation, permit, construction, technical inspection, occupancy permit and registration, plus special cases such as Article 145 works, reconstruction, accessibility, parking, fire safety, roads, water and heritage.
14. Complete example: client → AI → VPAA Rules → answer
Client: “I have a house with an underground garage in Belgrade. The ramp is 270 cm wide. Is that enough and what else should I check before submission?”
- The agent identifies a garage-ramp-width check and a broader pre-submission intent.
- It records only stated facts: Belgrade, house, underground garage, 270 cm ramp. It does not invent zone, number of vehicles or fire strategy.
- It reads the live tool/schema and maps 270 cm to the current canonical measurement metric.
- It calls
check_projectfor the specific check. - It explains only verified applicable findings, using the source returned by the tool.
- If the engine returns missing information, the agent asks for it.
- If the client also wants “everything before submission”, the agent can then call
audit_project, while clearly limiting the result to current verified coverage.