{
  "x402Version": 2,
  "service": "spec-slice",
  "title": "Spec Slice — OpenAPI & GraphQL Subgraph Extractor",
  "version": "1.0.0",
  "mcpEndpoint": "https://spec-slice.apikeg.com/mcp",
  "freeDiscovery": [
    "https://spec-slice.apikeg.com/llms.txt",
    "https://spec-slice.apikeg.com/llms-full.txt",
    "https://spec-slice.apikeg.com/openapi.json",
    "https://spec-slice.apikeg.com/.well-known/mcp.json",
    "https://spec-slice.apikeg.com/.well-known/api-catalog"
  ],
  "resources": [
    {
      "name": "slice_openapi_spec",
      "title": "Slice OpenAPI 3.0/3.1 or Swagger 2.0 Specification",
      "url": "https://spec-slice.apikeg.com/v1/slice-openapi-spec",
      "method": "POST",
      "description": "Scores OpenAPI/Swagger endpoints against a natural-language `query` (BM25 + boosted `operationId`, `summary`, `tags`, and path tokens) or explicit `operationIds`/`pathPatterns`, walks every reachable JSON Pointer `$ref` with cycle protection, prunes unused paths/components, and emits ready-to-use `curl` + TypeScript `fetch` snippets. Why call instead of DIY: Saves 50,000-250,000 prompt tokens per large enterprise OpenAPI spec ($0.15+ LLM input cost) while guaranteeing zero broken `#/components/...` `$ref` links or recursive schema crashes. Pricing: $0.001 USD per OpenAPI/Swagger subgraph slice (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "1000",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "maxTimeoutSeconds": 60,
          "extra": {
            "priceUsd": "0.001",
            "unitDescription": "per OpenAPI/Swagger subgraph slice",
            "dryRunQueryParam": "?dry_run=true"
          }
        }
      ],
      "extensions": {
        "bazaar": {
          "discoverable": true,
          "category": [
            "developer-tools",
            "api-tooling",
            "context-compression",
            "agent-infrastructure"
          ],
          "info": {
            "input": {
              "type": "http",
              "method": "POST",
              "bodyType": "json",
              "example": {
                "query": "create credit note and refund invoice",
                "maxOperations": 2,
                "compactDescriptions": true,
                "includeSnippets": true,
                "spec": {
                  "openapi": "3.1.0",
                  "info": {
                    "title": "Billing API",
                    "version": "2.4.0"
                  },
                  "servers": [
                    {
                      "url": "https://api.billing.example.com"
                    }
                  ],
                  "paths": {
                    "/v1/invoices/{invoiceId}/refunds": {
                      "post": {
                        "operationId": "refundInvoice",
                        "summary": "Refund an invoice",
                        "tags": [
                          "Invoices"
                        ],
                        "requestBody": {
                          "content": {
                            "application/json": {
                              "schema": {
                                "$ref": "#/components/schemas/RefundRequest"
                              }
                            }
                          }
                        },
                        "responses": {
                          "200": {
                            "description": "Refund created",
                            "content": {
                              "application/json": {
                                "schema": {
                                  "$ref": "#/components/schemas/Refund"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "/v1/warehouses": {
                      "get": {
                        "operationId": "listWarehouses",
                        "summary": "List inventory warehouses",
                        "responses": {
                          "200": {
                            "description": "OK",
                            "content": {
                              "application/json": {
                                "schema": {
                                  "$ref": "#/components/schemas/Warehouse"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "components": {
                    "schemas": {
                      "RefundRequest": {
                        "type": "object",
                        "required": [
                          "amountCents"
                        ],
                        "properties": {
                          "amountCents": {
                            "type": "integer"
                          }
                        }
                      },
                      "Refund": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          }
                        }
                      },
                      "Warehouse": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "location": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "output": {
              "type": "json",
              "summary": "Retains refundInvoice + RefundRequest + Refund, prunes listWarehouses + Warehouse, and emits curl + TypeScript fetch snippets."
            }
          },
          "schema": {
            "inputSchema": {
              "type": "object",
              "properties": {
                "spec": {
                  "description": "OpenAPI 3.0/3.1 or Swagger 2.0 specification provided as either a parsed JSON object or a serialized JSON string (up to 5 MiB)."
                },
                "query": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "Natural-language task intent (e.g. 'create credit note and refund invoice') scored via Okapi BM25 plus boosted matches on operationId, summary, tags, and path segments."
                },
                "operationIds": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "maxItems": 50,
                  "description": "Explicit operationId values to extract (case-insensitive)."
                },
                "pathPatterns": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  },
                  "maxItems": 50,
                  "description": "Explicit path templates or 'METHOD /v1/path/*' glob patterns to extract (e.g. 'POST /v1/invoices/*/refund')."
                },
                "methods": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "GET",
                      "POST",
                      "PUT",
                      "PATCH",
                      "DELETE",
                      "HEAD",
                      "OPTIONS",
                      "TRACE"
                    ]
                  },
                  "maxItems": 8,
                  "description": "Optional HTTP method allowlist."
                },
                "maxOperations": {
                  "type": "integer",
                  "default": 5,
                  "minimum": 1,
                  "maximum": 50,
                  "description": "Maximum number of matched operations to retain in the sliced OpenAPI spec."
                },
                "compactDescriptions": {
                  "type": "boolean",
                  "default": false,
                  "description": "Strip verbose prose descriptions, examples, and externalDocs while keeping spec-valid response descriptions."
                },
                "includeSnippets": {
                  "type": "boolean",
                  "default": true,
                  "description": "Generate ready-to-use curl and TypeScript fetch code snippets for each selected operation."
                }
              },
              "required": [
                "spec"
              ],
              "additionalProperties": false
            },
            "outputSchema": {
              "type": "object",
              "required": [
                "ok",
                "data",
                "_meta"
              ],
              "properties": {
                "ok": {
                  "type": "boolean",
                  "const": true
                },
                "data": {
                  "type": "object",
                  "description": "Deterministic structured tool result payload."
                },
                "_meta": {
                  "type": "object",
                  "required": [
                    "requestId",
                    "durationMs",
                    "chargedUsd",
                    "dryRun"
                  ],
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "durationMs": {
                      "type": "number"
                    },
                    "chargedUsd": {
                      "type": "string"
                    },
                    "dryRun": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "name": "slice_graphql_schema",
      "title": "Slice GraphQL SDL Schema to Minimal Subgraph",
      "url": "https://spec-slice.apikeg.com/v1/slice-graphql-schema",
      "method": "POST",
      "description": "Parses GraphQL Schema Definition Language (`Query`, `Mutation`, `Subscription`, `type`, `input`, `interface`, `union`, `enum`, `scalar`), scores root fields against `query` or explicit `rootFields`, and emits a valid mini-SDL containing only selected root fields and the transitive closure of referenced types. Why call instead of DIY: Replaces heavyweight `graphql-js` AST bundlers on edge runtimes and shrinks 10,000-line federated GraphQL schemas into minimal, copy-pasteable mini-SDL + sample operations. Pricing: $0.001 USD per GraphQL SDL subgraph slice (x402 instant micropayment). Pass ?dry_run=true on REST to validate schema free.",
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "1000",
          "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "payTo": "0x000000000000000000000000000000000000dEaD",
          "maxTimeoutSeconds": 60,
          "extra": {
            "priceUsd": "0.001",
            "unitDescription": "per GraphQL SDL subgraph slice",
            "dryRunQueryParam": "?dry_run=true"
          }
        }
      ],
      "extensions": {
        "bazaar": {
          "discoverable": true,
          "category": [
            "developer-tools",
            "api-tooling",
            "context-compression",
            "agent-infrastructure"
          ],
          "info": {
            "input": {
              "type": "http",
              "method": "POST",
              "bodyType": "json",
              "example": {
                "query": "issue credit note for invoice",
                "maxRootFields": 2,
                "compactDescriptions": true,
                "sdl": "scalar DateTime\nenum CreditReason { DUPLICATE OVERCHARGE }\ninput IssueCreditNoteInput { invoiceId: ID! reason: CreditReason! }\ntype CreditNote { id: ID! issuedAt: DateTime! }\ntype Warehouse { id: ID! code: String! }\ntype Query { warehouses: [Warehouse!]! }\ntype Mutation { issueCreditNote(input: IssueCreditNoteInput!): CreditNote! }"
              }
            },
            "output": {
              "type": "json",
              "summary": "Emits mini-SDL with DateTime, CreditReason, IssueCreditNoteInput, CreditNote, and Mutation.issueCreditNote while pruning Warehouse and Query.warehouses."
            }
          },
          "schema": {
            "inputSchema": {
              "type": "object",
              "properties": {
                "sdl": {
                  "type": "string",
                  "minLength": 1,
                  "description": "Full GraphQL Schema Definition Language (SDL) string."
                },
                "query": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "Natural-language task intent scored against root Query, Mutation, and Subscription fields."
                },
                "rootFields": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "maxItems": 50,
                  "description": "Explicit root field names to extract (e.g. 'createCreditNote' or 'Mutation.refundInvoice')."
                },
                "operationTypes": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "Query",
                      "Mutation",
                      "Subscription"
                    ]
                  },
                  "maxItems": 3,
                  "description": "Optional filter restricting root operation containers."
                },
                "maxRootFields": {
                  "type": "integer",
                  "default": 5,
                  "minimum": 1,
                  "maximum": 50,
                  "description": "Maximum number of matched root fields to retain in the mini-SDL."
                },
                "compactDescriptions": {
                  "type": "boolean",
                  "default": false,
                  "description": "Strip triple-quoted and single-line descriptions from the emitted mini-SDL."
                }
              },
              "required": [
                "sdl"
              ],
              "additionalProperties": false
            },
            "outputSchema": {
              "type": "object",
              "required": [
                "ok",
                "data",
                "_meta"
              ],
              "properties": {
                "ok": {
                  "type": "boolean",
                  "const": true
                },
                "data": {
                  "type": "object",
                  "description": "Deterministic structured tool result payload."
                },
                "_meta": {
                  "type": "object",
                  "required": [
                    "requestId",
                    "durationMs",
                    "chargedUsd",
                    "dryRun"
                  ],
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "durationMs": {
                      "type": "number"
                    },
                    "chargedUsd": {
                      "type": "string"
                    },
                    "dryRun": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  ]
}