Schema Converter · template

Protobuf to JSON Schema

Turn a proto3 message into a JSON Schema from your AI assistant.

You have a .proto file. You need a JSON Schema. Use this when the same record must be checked as JSON. The output keeps the field names and an enum for the allowed values. Check the enum values, because their names change. The page shows the recorded output and lists what did not carry over.

What you get

A JSON Schema with seven properties. status has a list of allowed values. This is the answer CoreModels gave on 3 December 2026 for the file below.

order.schema.json

{
  "type": "object",
  "properties": {
    "order_id": {
      "type": "string"
    },
    "customer_id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "ORDERSTATUSUNSPECIFIED",
        "ORDERSTATUSPLACED",
        "ORDERSTATUSSHIPPED",
        "ORDERSTATUSDELIVERED",
        "ORDERSTATUSRETURNED"
      ]
    },
    "total_amount": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "placed_at": {
      "type": "string"
    },
    "discount_code": {
      "type": "string"
    }
  },
  "required": [
    "order_id",
    "customer_id",
    "status",
    "total_amount",
    "currency"
  ]
}

What you need

  • A CoreModels account with one project. Every plan starts with a 14-day free trial; a card is required to start.
  • The tool uses the project only to check your access. It writes nothing.
  • An assistant that speaks MCP, such as Claude Code, Claude Desktop or Cursor.
  • A Protobuf file with one flat record.

Run it

1. Connect your assistant

In Claude Code, run this command. Then sign in when it asks.

claude mcp add --transport http coremodels https://go.coremodels.io/mcp

Cursor, Claude Desktop and other clients: connect guide.

2. Save the file as order.proto

Use your own file, or start with this one.

order.proto

syntax = "proto3";

package org.example.shop;

import "google/protobuf/timestamp.proto";

// Where the order is now.
enum OrderStatus {
  ORDER_STATUS_UNSPECIFIED = 0;
  ORDER_STATUS_PLACED = 1;
  ORDER_STATUS_SHIPPED = 2;
  ORDER_STATUS_DELIVERED = 3;
  ORDER_STATUS_RETURNED = 4;
}

// A purchase order placed by a customer.
message Order {
  // Order number printed on the receipt.
  string order_id = 1;

  // The customer who placed the order.
  string customer_id = 2;

  // Where the order is now.
  OrderStatus status = 3;

  // Order total, tax included.
  // Decimal (precision 12, scale 2) encoded as a canonical decimal string.
  string total_amount = 4;

  // ISO 4217 currency code.
  string currency = 5;

  // When the customer placed the order.
  google.protobuf.Timestamp placed_at = 6;

  // Code used at checkout, if any.
  optional string discount_code = 7;
}

3. Ask for the conversion

Use the CoreModels transform_schema tool to convert order.proto from protobuf to jsonschema. Pass the whole file as sourceSchema and again as targetHintSchema. Use any project from list_projects. Save the result as order.schema.json, then list every entry in lossiness.

Your assistant calls transform_schema with these arguments. The file goes in twice: once as the source, once as the hint the mapping matches against. Without the hint the tool refuses the call.

transform_schema

{
  "graphProjectId": "<your project id>",
  "sourceFormat": "protobuf",
  "sourceSchema": "<contents of order.proto>",
  "targetFormat": "jsonschema",
  "targetHintFormat": "protobuf",
  "targetHintSchema": "<contents of order.proto>"
}

What did not carry over

  • We tested one flat record. Nested records and lists are not tested on this page.

CoreModels reported these changes with the answer:

  • imports: import "google/protobuf/timestamp.proto" is preserved verbatim but not resolved; types it defines decode as approximations.

We compared the two files ourselves and also found:

  • Descriptions. Each field has a description in the input. The output has none.
  • The time type. placed_at is a date and time in the input and a plain string in the output.
  • The namespace, package or schema id of the input file.
  • The exact value names. Underscores are removed, so ORDER_STATUS_PLACED becomes ORDERSTATUSPLACED.
  • Field numbers. Protobuf fields have numbers. The output has no place for them.
  • Required fields. The output marks plain fields as required. The proto3 input does not say that.

Compare your own files too. A different file can lose other things.

Check it yourself

Validate the file against its own JSON Schema dialect.

pip install check-jsonschema
check-jsonschema --check-metaschema order.schema.json

Same file, other formats

← Back to Schema Converter

Start building

14-day free trial. Builder $49/mo after the trial. Cancel any time.