{"openapi":"3.1.0","info":{"title":"Code Practice API","version":"0.1.0","description":"Language-agnostic algorithm/data-structure practice problems with progressive hints, a CS concept reference, and a genuine Big-O complexity comparator — all local.\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://codepractice.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"hr@unifydynamics.com","url":"https://connectorbay.com/codepractice/docs"},"termsOfService":"https://connectorbay.com/codepractice/terms"},"servers":[{"url":"https://codepractice.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/codepractice/docs"},"security":[{},{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/list_topics":{"post":{"operationId":"list_topics","summary":"Lists practice topics, difficulty tiers, and how many problems exist per topic.","description":"Lists practice topics, difficulty tiers, and how many problems exist per topic.","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"list_topicsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/practice_problems":{"post":{"operationId":"practice_problems","summary":"Returns practice problems (statement + example input/output; hints are separate, via `hint`), filtered by","description":"Returns practice problems (statement + example input/output; hints are separate, via `hint`), filtered by\n    topic and/or difficulty. Use for \"give me a medium recursion problem\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"topic":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"arrays | strings | recursion | sorting | searching | trees | graphs","title":"Topic"},"difficulty":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"beginner | easy | medium | hard","title":"Difficulty"},"count":{"default":5,"maximum":10,"minimum":1,"title":"Count","type":"integer"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"description":"Fixed seed for reproducible selection.","title":"Seed"}},"title":"practice_problemsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_problem":{"post":{"operationId":"get_problem","summary":"Looks up a single problem by id.","description":"Looks up a single problem by id.","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"problem_id":{"description":"A problem id, e.g. 'rec-3' (from practice_problems).","title":"Problem Id","type":"string"}},"required":["problem_id"],"title":"get_problemArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/hint":{"post":{"operationId":"hint","summary":"Gives one progressive hint for a problem, from a gentle nudge (level 1) up to a near-solution (the","description":"Gives one progressive hint for a problem, from a gentle nudge (level 1) up to a near-solution (the\n    problem's highest level). Use for \"give me a hint for problem rec-3\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"problem_id":{"description":"A problem id, e.g. 'rec-3'.","title":"Problem Id","type":"string"},"level":{"default":1,"description":"1 = a nudge, up to the problem's max level = a near-solution.","maximum":3,"minimum":1,"title":"Level","type":"integer"}},"required":["problem_id"],"title":"hintArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_concepts":{"post":{"operationId":"list_concepts","summary":"Lists the CS concepts available via explain_concept.","description":"Lists the CS concepts available via explain_concept.","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"list_conceptsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/explain_concept":{"post":{"operationId":"explain_concept","summary":"Explains a CS fundamental (algorithm or data structure) with its typical time/space complexity and a short","description":"Explains a CS fundamental (algorithm or data structure) with its typical time/space complexity and a short\n    example. Use for \"what's a hash table\", \"explain dynamic programming\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"concept":{"description":"e.g. big_o_notation, binary_search, hash_table, dynamic_programming.","title":"Concept","type":"string"}},"required":["concept"],"title":"explain_conceptArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/compare_complexity":{"post":{"operationId":"compare_complexity","summary":"Says which of two complexity expressions grows asymptotically faster, via real parsing of the expression","description":"Says which of two complexity expressions grows asymptotically faster, via real parsing of the expression\n    into a canonical growth-rate class (constant, logarithmic, linear, linearithmic, polynomial of any degree,\n    exponential of any base, factorial, or n^n) — not a lookup of specific known strings. Use for \"which grows\n    faster, O(n log n) or O(n^2)\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"expr_a":{"description":"A Big-O expression, e.g. 'O(n log n)'.","examples":["O(n log n)"],"title":"Expr A","type":"string"},"expr_b":{"description":"A Big-O expression to compare against.","examples":["O(n^2)"],"title":"Expr B","type":"string"}},"required":["expr_a","expr_b"],"title":"compare_complexityArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/order_complexities":{"post":{"operationId":"order_complexities","summary":"Sorts a list of Big-O complexity expressions from slowest- to fastest-growing. Use for \"put these","description":"Sorts a list of Big-O complexity expressions from slowest- to fastest-growing. Use for \"put these\n    complexities in order\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"expressions":{"description":"Big-O expressions to sort by growth rate.","examples":[["O(n^2)","O(1)","O(2^n)","O(log n)","O(n)"]],"items":{"type":"string"},"maxItems":20,"minItems":1,"title":"Expressions","type":"array"}},"required":["expressions"],"title":"order_complexitiesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}