[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-108040":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":12,"stars30d":12,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":14,"rankGlobal":9,"rankLanguage":9,"license":15,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":16,"hasPages":16,"topics":18,"createdAt":9,"pushedAt":19,"updatedAt":20,"readmeContent":21,"aiSummary":22,"trendingCount":12,"starSnapshotCount":12,"syncStatus":23,"lastSyncTime":24,"discoverSource":25},108040,"gatool","api-agent-bridge\u002Fgatool","api-agent-bridge","Spring Boot starters that turn curated GraphQL operation files into MCP tools and in-process Spring AI tools",null,"Java",68,0,1,40,"Apache License 2.0",false,"main",[],"2026-11-17 06:34:53","2026-11-21 05:57:03","# GATool\n\nSpring Boot starters that turn trusted GraphQL documents into tools an AI\nagent can call, over MCP or in-process through Spring AI.\n\n## What it does\n\nWrite a GraphQL query in a file, and GATool publishes it as a tool:\n\n```graphql\n# Returns the highest-rated movies, best first.\nquery TopRatedMovies($first: Int = 10) {\n  topRatedMovies(first: $first) {\n    id\n    title\n    rating\n  }\n}\n```\n\nThe operation name becomes the tool name; the comment above it becomes the\ndescription an agent reads, and the variables become the tool's input schema. An\nagent calls the tool with arguments, GATool sends this document to your GraphQL\nAPI, and the `data` and `errors` of the JSON response go back as the tool result,\nwritten again by GATool: `extensions` and any other top-level key stay out, and a\nnumber reaches the model with every digit the API sent.\n\nThe operations are trusted documents: the repository holds the list of queries\nthat exist, a pull request reviews each one, and the agent chooses from that\nlist. The schema stays out of the agent's context, and the API receives\nonly the documents in the repository, each one as graphql-java prints it, without\nits comments. `CheckedTool.document()` in the CI check returns the text GATool\nsends. The advice on what to hash waits for the release that sends persisted\ndocuments.\n\n## Getting started\n\nAdd the MCP starter:\n\n```xml\n\u003Cdependency>\n    \u003CgroupId>io.gatool\u003C\u002FgroupId>\n    \u003CartifactId>gatool-mcp-spring-boot-starter\u003C\u002FartifactId>\n    \u003Cversion>0.1.0\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n\nPut the query above in `src\u002Fmain\u002Fresources\u002Fgatool\u002Fmcp\u002FTopRatedMovies.graphql`, and\npoint the application at your API:\n\n```yaml\ngatool:\n  api:\n    url: https:\u002F\u002Fmovies.example.com\u002Fgraphql\n    schema:\n      location: classpath:movies.graphqls\n  mcp:\n    security:\n      unsafe:\n        allow-mcp-calls-without-authentication: true\n```\n\nThe schema file is what GATool validates every operation against at startup. A\nquery that names a field the schema lacks stops startup with a message naming\nthe file and the field. It fails the build as well once the CI assertion under\n\"The operation files validate\" is in place, and a test that starts the context\nfails the same way.\n\nGATool builds the schema with graphql-java, which refuses one schema that the\nGraphQL specification allows: a type that gives an argument another default\nthan its interface declares, such as `memberOf(limit: Int! = 150)` under an\ninterface that declares `limit: Int! = 100`. Startup stops and names each such\nargument, and\n[graphql-java#4480](https:\u002F\u002Fgithub.com\u002Fgraphql-java\u002Fgraphql-java\u002Fissues\u002F4480)\nasks graphql-java to build such a schema. Until a release does, a copy of the\nschema that gives those arguments the default of their interface starts, and\nGATool then describes that default where the API applies its own.\n\nWithout Spring Security on the classpath, that switch is required, and the\napplication logs a warning at every startup while it is on. Keep the endpoint on\na loopback address with `server.address`, or behind a gateway that authenticates\nfor it. The section on securing the endpoint below shows the other way: add the\nresource server starter, name the issuer, and leave the switch off.\n\nStart the application, and an agent that connects to `\u002Fmcp` reads one tool. The\nentry is shortened here: the one on the wire also carries a `title`, the\n`$schema` and the `$id` of the input schema, and the hints `destructiveHint`\nand `idempotentHint`.\n\n```json\n{\n  \"name\": \"topRatedMovies\",\n  \"description\": \"Returns the highest-rated movies, best first.\",\n  \"inputSchema\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"first\": {\n        \"anyOf\": [{ \"type\": \"integer\" }, { \"type\": \"null\" }],\n        \"description\": \"How many movies to return.\",\n        \"default\": 10\n      }\n    },\n    \"required\": [],\n    \"additionalProperties\": false\n  },\n  \"annotations\": { \"readOnlyHint\": true }\n}\n```\n\n## In-process tools for Spring AI\n\nThe second starter hands the same operation files to a `ChatClient`, without an\nMCP server:\n\n```xml\n\u003Cdependency>\n    \u003CgroupId>io.gatool\u003C\u002FgroupId>\n    \u003CartifactId>gatool-in-process-spring-boot-starter\u003C\u002FartifactId>\n    \u003Cversion>0.1.0\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n\n```java\n@Bean\nChatClient assistant(ChatClient.Builder builder, GAToolCallbacks tools) {\n    return builder.defaultTools(tools.toolCallbackProvider()).build();\n}\n```\n\n`ChatClient.Builder` comes from a Spring AI chat model starter, such as\n`spring-ai-starter-model-anthropic`, which the application adds beside this\none.\n\nFiles under `gatool\u002Fin-process\u002F` reach the `ChatClient`, and files under `gatool\u002Fmcp\u002F`\nreach the MCP server, so one application can serve both with different lists.\nAn in-process tool runs inside the application, so the scopes an operation file\nlists, the rate limiter and Spring AI's `ToolContext` stay out of its path: the\ntool takes its arguments from the text alone, and the caller is the application\nitself. Under `token-exchange` and under the forwarded token, the caller is\nthe user on the thread that calls the tool, because both strategies read the\ntoken from that thread's security context. Under a per-caller credential,\nGATool refuses a call where the thread's security context may belong to\nanother caller, described under\n[The caller and the request thread](#the-caller-and-the-request-thread). The\narguments travel to the API as the model wrote them: an argument the input\nschema does not name is forwarded\nas sent, and one left out stays out, so a misspelled name gets the API's answer\nfor the unnamed argument, its default or its own error, where the MCP path\nrefuses the call before the API sees it. A later minor release may validate\narguments before the call, as the MCP side does. A scope list on such a file\nstates what the application has to enforce, with method security on the\nresolver or in the code that builds the `ChatClient`, and the startup listing\nsays so beside the tool. Spring AI's own `spring.ai.tool` observation covers\neach call. A refusal, such as a credential the configured strategy could not\nsupply, reaches the model as a plain sentence of text, where an answer arrives\nas the same GraphQL envelope the MCP path returns.\n\n## How a tool is built\n\n- **One file makes one tool.** An operation file holds one operation and the\n  fragments it spreads, and a file that holds a second operation stops startup.\n  A file that holds a subscription, or that uses `@defer` or `@stream`, stops\n  startup as well, because a tool call returns one result.\n- **The name** comes from the operation name through a naming strategy, and\n  `camelCase` is the default. `@gatool(name: \"movies_top_rated\")` sets an\n  explicit name, and a `ToolNamingStrategy` bean replaces the strategy. An\n  operation written without a name takes one from its file, so\n  `top-rated-movies.graphql` and `TopRatedMovies.graphql` both give\n  `topRatedMovies`. Under `as-written`, the file's own case is kept, and a run\n  of separators becomes one underscore, so the first file gives\n  `top_rated_movies`. An operation written without a name, in a file whose\n  name holds a letter outside ASCII such as `über-filme.graphql`, is refused on\n  every platform, whether the file system hands the name over composed or\n  decomposed. Name the operation in the file, and the file keeps its name. An explicit name follows the same rules as a strategy's:\n  letters, digits, `_` and `-`, at most 64 characters, at least one letter or\n  digit.\n- **The description** comes from the comment directly above the operation.\n  Without one, it comes from the schema description of the root field the\n  operation selects, and startup warns when both are silent. A comment or a\n  schema description made of characters that render empty, such as a no-break\n  space, counts as silent. Where the schema marks that root field `@deprecated`,\n  the description ends with the deprecation and the schema's reason, as in\n  `Lists every movie. Deprecated: Use movies.`, so a model reads that the API is\n  removing what the tool calls. The sentence follows the comment as it follows\n  the schema description, and a generated tool carries the same one. A\n  deprecated field deeper in the selection, and one root field of several,\n  reach the startup warning alone. A description written as a string ahead of\n  the operation, which the September 2025 edition of GraphQL allows, is refused\n  at startup, because graphql-java 25.0 predates that syntax; the refusal says\n  so and points at the `#` lines.\n- **The input schema** comes from the variables, with their types, their\n  descriptions and their defaults. An `ID` argument accepts a string or an\n  integer, which is what GraphQL's own input coercion takes, and an `ID` in a\n  result is a string, which is what a conforming service serializes. A default\n  is published as the JSON Schema `default` keyword, coerced the way GraphQL\n  coerces it, so a model reads what it gets by leaving the argument out. A whole\n  number keeps every digit the file wrote, so a `Long` default past 64 bits\n  publishes as those digits, and a default that fails the property beside it is\n  left out and named at startup. A nullable variable that fills a `@oneOf` input\n  field through a nullable argument or input field is refused even with a\n  default; declare it non-null. The September 2025 specification, section 5.8.5,\n  allows that default; graphql-js 17 refuses it in that position, and GATool\n  sides with graphql-js.\n- **The title** comes from `@gatool(title: \"Top rated movies\")`, and a blank\n  title is refused: one that is empty, and one made of spaces or of characters\n  that render empty, such as a no-break space or a zero-width space.\n- **The open world hint** comes from `@gatool(openWorld: true)` or\n  `@gatool(openWorld: false)`, which sets `openWorldHint` on the MCP tool\n  definition; a file that leaves it out publishes the tool without the hint.\n- **The question the user reads** comes from `@gatool(elicit: \"Delete this\n  order?\")`. On the stateful Streamable HTTP transport, and on stdio with\n  `gatool.mcp.stdio.elicitation=true` in an application without a web server,\n  GATool asks the user that question through MCP elicitation before each call\n  and runs the operation after an accept. A blank question is refused the way\n  a blank title is. The section\n  [Asking the user before a call](#asking-the-user-before-a-call) has the\n  rest.\n- **The result** is the `data` and `errors` of the GraphQL response as JSON\n  text, written again by GATool, so the response-level `extensions` and any\n  other top-level key stay out, while an error's own `extensions` travel with\n  the error. A `294 Partial Success`, or any 2xx under a JSON content type, is\n  read the same way as a `200`. A GraphQL error becomes a tool error that the\n  model can read and act on.\n- **A query carries `readOnlyHint`, and a mutation carries `destructiveHint`.**\n  A mutation file becomes a tool the same way a query file does, and the\n  operation type is what tells a client which it is.\n- **The output schema** is off by default. `gatool.results.publish-output-schema: true`\n  turns it on for every tool, and `@gatool(outputSchema: true)` or\n  `@gatool(outputSchema: false)` overrides that for one operation either way,\n  so an application can publish for the tools it trusts and hold back for one\n  awkward operation.\n\nEvery `@gatool` problem names the line and column of the argument it is about,\nand an empty or comment-only operation file is reported as empty. An operation\nfile, a shared fragment file and the schema file read the same with `\\n`, `\\r\\n`\nor a lone `\\r` ending each line, so a block string holds one value, and a tool\npublishes one contract, on a Windows checkout and on a Linux one. The three are\nthe operator's own text, so they are read however long they are, and \"The size\nof a document\" below says which limits remain and which the API sets.\n`gatool-core\u002Fsrc\u002Fmain\u002Fresources\u002Fio\u002Fgatool\u002Fcore\u002Fgatool-directives.graphqls` is\nthe SDL of the `@gatool` directive, for an editor's completion and a schema\nlinter; GATool reads the directive from the operation file itself, and the SDL\nfile serves editors alone.\n\n### What the input schema checks\n\nThe MCP SDK validates the arguments of a call against the published input\nschema before the tool runs, and the API coerces the values that reach it. The\ntable lists the positions where the two answer differently for one value:\n\n| Position | What the schema does | What the API does |\n| --- | --- | --- |\n| A Non-Null custom scalar published as `{}` | Accepts `null`, because the empty schema leaves every type open, `null` included. The variable stays in `required`, so a call that leaves it out is refused | Refuses the `null` with a request error, which the model reads as the tool error |\n| A list, such as `[Int!]!` | Refuses the single value `1999`, because the property says `array` | Takes `1999` as `[1999]`, which is GraphQL's input coercion for a list. A model sends the list, because the schema is what it reads |\n| An input type inside another of its own kind, and one past the node budget | Accepts a field the type lacks, because the object there is published with a description and without its fields | Refuses the field with a request error, which the model reads as the tool error |\n\nA custom scalar is published as `{}` until a fragment, or a specification\nGATool has read, describes it. A fragment that names a `type` closes the\nposition: the Non-Null variable then publishes that type without a null branch,\nand \"Custom scalars\" below shows how to write one. The third row covers two\ncases. A type that holds another of its own kind, such as a filter with `and`\nand `or`, lists its fields and closes the object where it first appears, and\nthe one inside it is published open. One variable expands at most 500 input\nobjects, and a position past that budget is published open as well, with a\nstartup warning that names it. An in-process tool sends its arguments without\nthis validation, so the API answers for every row there.\n\nA variable typed as a generated filter, the kind Hasura and PostGraphile\npublish, costs more than its one line in the operation suggests. One `where`\nvariable over eight tables with three relationships publishes an input schema\nof about 100,000 characters, and `tools\u002Flist` carries it to every client.\nStartup warns about a tool with more than 4,000 estimated tokens and names it. The way\nout is to declare the scalar variables the tool needs and to write the filter\nas a literal in the operation. The budget of 500 input objects and the text\npublished past it may change in a later release.\n\nThe schemas GATool writes are built for function calling without OpenAI's\nstrict mode. Two positions fail OpenAI's rules for a tool under `strict: true`:\nan optional property, since strict mode requires every property in `required`,\nand a custom scalar published as `{}`, since strict mode requires a `type` on\nevery property. A fragment under `gatool.inputs.scalar-schemas` closes the\nsecond position. The first stays open for a later release.\n\n### What the output schema promises\n\nMCP makes an output schema optional and binding: a server that publishes one\nmust return structured content that conforms to it on every call. GATool describes\nthe GraphQL response envelope, and the structured content is read back from the\nwritten text, so the two halves carry the same digits and nulls in embedded mode\nas well as remote. Where the selection set fails to prove a shape, the schema\nstays permissive:\n\n| Case | What the schema says |\n| --- | --- |\n| `data` | Nullable, because a failed call answers with `data: null` |\n| Any selected field | Present in `required`, and its value nullable |\n| A field under `@skip` or `@include` | Out of `required`, since the model decides whether it arrives |\n| A field inside a fragment with a type condition | Out of `required`, since another concrete type leaves it out. A condition naming the surrounding type, an interface it implements or a union holding it keeps its fields in `required`, because it holds for every object that can answer there |\n| An enum | `string`, without the value list, so a value the API adds before the schema file catches up still conforms |\n| A union or an interface | One branch per member the operation's type conditions cover, plus an open branch and `null` |\n| A custom scalar | The `type` and the `format` of its fragment under `gatool.inputs.scalar-schemas`, or its entry under `gatool.results.scalar-schemas` as written. A scalar without an entry in either map publishes the `type` and the `format` of the specification its `@specifiedBy` URL cites, where GATool has read it, and otherwise the empty schema, which accepts any JSON value |\n| `errors` | The GraphQL shape, an array of objects whose `message`, `locations`, `path` and `extensions` may each be null or left out, then `null`, then an open branch that accepts any JSON value. An API or a gateway in front of it writes other shapes, such as an entry without `message`, an entry that is a plain string, or one object where the list belongs, and each of them conforms |\n\nA response that carries errors beside its data conforms as well, so it arrives\nwith both halves: the tool error flag says the response carries errors, and the\nstructured content says what came back with them. Errors in a shape other than\nthe GraphQL one count as errors for that flag, and the text and the structured\ncontent carry them as the API wrote them. A refusal GATool writes itself,\nsuch as a result above the size limit, carries a sentence in place of the envelope\nand goes back as text alone.\n\nStructured content reaches an MCP client alone. Spring AI's in-process tools\ncarry text, so the `ChatClient` side is unchanged.\n\n### Unions, and the errors-as-data pattern\n\nA union or interface position publishes one branch per member its type\nconditions cover, with `__typename` pinned in each branch when the operation\nselects it:\n\n```graphql\nquery Pay($cardId: ID!) {\n  pay(cardId: $cardId) {\n    __typename\n    ... on Payment { id amountCents }\n    ... on InsufficientFunds { message shortfallCents }\n    ... on CardDeclined { message code }\n  }\n}\n```\n\npublishes a `Payment` branch keyed `{\"const\": \"Payment\"}`, one branch for each\nerror member, then an open `{\"type\": \"object\"}` branch and `{\"type\": \"null\"}`.\nBoth error members carry `message`, and the pinned `__typename` is what lets a\nmodel tell them apart, which is what it switches on.\n\nThat shape describes more than it validates: with the open branch present, the\nposition enforces \"an object, or null\", and the branches are there for the\nmodel to read. The open branch is what makes the rest safe, because a member\nthe API adds after the operation file was written lands there, where otherwise\na call would fail on an operation file that had not changed.\n\nAn operation that leaves `__typename` out gets the same branches without the\n`const`, and startup warns: nothing in the response then tells a model which\nmember it is holding, and GATool takes only its own directive out of a document,\nso it does not add `__typename` to your query. A type condition naming the\nposition's own type, or an interface it declares, adds to the one shape every\nmember shares without a branch of its own, so a fragment on `Node` at a `node`\nposition publishes one shape and startup stays quiet. One output schema holds\nat most 500 object shapes; a position past that bound is published as an open\nobject; a result there still conforms, and startup names the position.\n\n### Custom scalars\n\nA custom scalar reaches a model as `{}`, the schema that accepts any JSON value,\nso the model guesses the format and learns it from the API's request error. A\n`@specifiedBy` URL GATool has read narrows that, and so does a fragment you\nwrite.\n\n**A `@specifiedBy` URL GATool has read.** Every specification the community\nregistry publishes was read, 31 of them, plus RFC 4122 and RFC 3986, which the\nGraphQL specification writes in its own examples. Nine carry a JSON Schema\n`format`, and the rest carry the shape in prose, because their format would\nrefuse a value the API takes. The URL is normalised before the lookup, so the\nspellings of one page find one entry: `tools.ietf.org` and `datatracker.ietf.org`\nfor an RFC, with or without `.html`, and with or without a section anchor. The\nscalar keeps its own description either way, and where no format is named, the\nproperty carries the URL so the model can see which page defines the value.\n\n**A fragment you write.** Most schemas leave `@specifiedBy` unset, and a scalar's\nname is only a name: the values its API takes live in coercion the schema leaves\nout. So you state the format:\n\n```yaml\ngatool:\n  inputs:\n    scalar-schemas:\n      DateTime:\n        type: string\n        format: date-time\n        description: An RFC 3339 timestamp, for example 2026-09-18T10:00:00Z.\n```\n\nStartup names every scalar still undescribed, so the warning tells you which\nones to write. A fragment wins over the `@specifiedBy` table, and its\n`description` stands in place of the scalar's own.\n\nSix keywords are published, and startup refuses the rest with the reason:\n\n| Keyword | What it does |\n| --- | --- |\n| `type` | `string`, `integer`, `number` or `boolean`. It asserts, so an incorrect value is rejected before it reaches your API. GATool writes the null branch itself |\n| `format` | One of the ten Anthropic documents: `date-time`, `time`, `date`, `duration`, `email`, `hostname`, `uri`, `ipv4`, `ipv6` and `uuid`. It guides the model, and validation reads past it. OpenAI's strict subset leaves `uri` out, so a fragment writing it publishes with a startup warning |\n| `pattern` | A regular expression the string has to match. It asserts, so prefer one that over-accepts. It stays inside the syntax Java and ECMA 262 share: inline flags, `\\A`, `\\z`, `\\Z`, `\\Q...\\E`, `\\p{...}`, the escapes `\\R`, `\\h`, `\\H`, `\\v`, `\\V`, `\\X`, `\\G`, `\\e`, `\\a`, `\\N{...}` and `\\x{...}`, `&&` or a nested `[...]` inside a class, possessive quantifiers and atomic groups are refused by name, because a client compiles the pattern as ECMA 262. Lookaround, a backreference, a named group and `\\b` are refused as well, because Anthropic's strict tool use answers them with `400 Invalid regex in pattern field` |\n| `enum` | A closed value set, which only the API's owner knows. It asserts, because the MCP SDK's validator enforces it |\n| `description` | The highest-leverage field here, and the replacement for every refused keyword |\n| `anyOf` | Two to eight branches, for a scalar with more than one wire form |\n\nA numeric bound is refused because Anthropic's strict tool use answers `minimum`\nwith HTTP 400: `For 'integer' type, properties maximum, minimum are not\nsupported`. `oneOf` is refused the same way. State a bound in `description`,\nwhich is what Anthropic's own SDKs do.\n\nThree of the six assert, so a fragment can refuse a call before the API sees it:\n`type`, `pattern` and `enum`, each measured against the MCP SDK's own validator. That is\nthe cost of describing a scalar, and it is why the fragment is yours to write:\nyou know whether your `Long` travels as a number, as a quoted string, or as\neither. Write the wider shape when you are unsure, and let the API answer the\nrest.\n\n**A profile adds to a fragment.** `gatool.inputs.scalar-schemas` is a map of\nmaps, and Spring Boot merges a map across property sources. A fragment written\nin `application.yml` and again in `application-prod.yml` therefore publishes\nthe keywords of both files. The profile changes the value of a keyword the base\nfile wrote, and it adds keywords of its own. A keyword the base file wrote\nstays in the fragment while the profile leaves it out. A profile that writes\n`type: string` and `format: date-time` over a base fragment holding a `pattern`\nfor a date publishes all three, and the timestamp its description asks for then\nfails the pattern. Keep a keyword that differs between environments out of the\nbase file and write it in each profile, or write it in the profile with the\nvalue that profile needs. `gatool.results.scalar-schemas` merges the same way.\n\n**A result reuses the fragment.** You write the fragment once. Where a tool\npublishes an output schema, a result describes the scalar from the same fragment:\nits `type`, its `format` and its `description`, and for a fragment that is an\n`anyOf`, the `type` and the `format` of each branch. GATool writes `null` beside\nthem, as it does for every value of a result. The description is written at the\nfirst position of each output schema where the scalar appears and left out at the\nlater ones, because the schema travels in every `tools\u002Flist`.\n\n`enum` and `pattern` stay on the input side. A fragment says what a model should\nsend, and you may write it narrower than the API on purpose: an `enum` that lists\nfewer values than the API holds, or a `pattern` that asks for `2026-09-28` while\nthe API returns `2026-09-28T00:00:00Z`. An output schema is binding in MCP, so a\nresult that fails it is reported as an error after the API already ran the call,\nand for a mutation that invites a retry of a write that was applied. `type` and\n`format` describe the wire form, which a scalar normally shares in both\ndirections.\n\nOne case needs a second entry: a scalar that returns another form than it\naccepts. A `Money` that is accepted as a number and returned as a quoted string\nfails the reused `type: number` on every result, so\n`gatool.results.scalar-schemas` states what a result carries:\n\n```yaml\ngatool:\n  inputs:\n    scalar-schemas:\n      Money:\n        type: number\n        description: An amount with two decimals, for example 12.50.\n  results:\n    scalar-schemas:\n      Money:\n        type: string\n        description: An amount with two decimals, as a quoted string such as \"12.50\".\n```\n\nAn entry there follows the rules of the table above. The output schema publishes\nit as written, its `enum` and `pattern` included, because you wrote them about\nresults, and it takes the place of the input fragment there. The input schema\nreads `gatool.inputs.scalar-schemas` alone. To switch the reuse off for one\nscalar, give it an entry under `gatool.results.scalar-schemas` that holds a\n`description` alone: its results then publish the empty schema, which accepts any\nJSON value.\n\nA scalar without a fragment that cites a specification GATool has read publishes\nthe `type` and the `format` of that specification in a result, as it does in an\nargument, because a specification states one wire form for both directions. A\nfragment wins over the specification on both sides. An API that cites a\nspecification and returns another form takes an entry under\n`gatool.results.scalar-schemas`, like any scalar that returns another form than\nit accepts.\n\n**A 64-bit integer needs both forms.** A JSON reader using IEEE 754 binary64\nchanges `9223372036854775807` into `9223372036854776000`, so a model can send the\nright digits and a client still hands the server a different number:\n\n```yaml\ngatool:\n  inputs:\n    scalar-schemas:\n      Long:\n        anyOf:\n          - type: integer\n          - type: string\n            pattern: \"^-?(0|[1-9][0-9]{0,18})$\"\n        description: >-\n          A 64-bit signed integer. Send a value outside -9007199254740991 to\n          9007199254740991 as a quoted string, for example \"9223372036854775807\".\n```\n\nWhether the string branch belongs there depends on the API. graphql-java's\nextended `Long` takes both forms, and three different `Long` specifications are\npublished, one of which takes the string alone. That is the reason the fragment\nis yours to write: the same scalar name means different things behind different\nAPIs.\n\n**A decimal reaches the API with every digit.** GATool's own mapper reads a\nfloat as a `BigDecimal` on every surface: a result, an in-process argument and\nan MCP argument, so `spring.jackson.deserialization.use-big-decimal-for-floats`\nis unnecessary. The `mcpServerJsonMapper` bean that the MCP transport reads a\nrequest with enables the same setting, `USE_BIG_DECIMAL_FOR_FLOATS`. The digits\nan API receives can differ from what a model wrote, because a `BigDecimal`\nprints its own way: `1e2` reaches the API as `1E+2`, and `12.50` reaches it as\n`12.50`, both valid JSON numbers. A decimal past the range of a `double`, such\nas `1E400`, reaches the API as a number.\n\n### Shared fragments\n\nAn operation file defines the fragments it spreads, and a fragment several\noperations share can live in a file of its own, for example under\n`gatool\u002Fmcp\u002Ffragments\u002F`. A file that holds fragments alone becomes a shared\nfragment file for the locations that reach it. Startup attaches each shared\nfragment to every operation that spreads it and validates the assembled\ndocument. The fragments are appended in the order of the first spread, depth\nfirst, so the text an API receives stays the same between builds.\n\n- A spread resolves to the operation file's own fragment first, and to a shared\n  fragment file on the same side second, so two operation files may each define\n  their own `MovieCard`.\n- An operation file whose own fragment has the name of a shared one keeps its\n  own, and startup warns about naming both files.\n- Two shared fragment files on one side that define the same name stop startup,\n  and the message names both files.\n- A shared fragment that every operation file leaves unspread earns a warning\n  with its file and is validated on its own, so a wrong field in it stops\n  startup with the fragment file's line and column, and a spread without a\n  definition in either place stops startup the way any validation error does.\n- `@defer` and `@stream` inside a shared fragment file stop startup the way they\n  do in an operation file, naming the fragment file, and a validation error\n  inside a shared fragment names the fragment file with its own line and column\n  beside the operation file.\n\nThe CI check returns the assembled text of every tool, and the startup listing\nprints it at `DEBUG` for `io.gatool` for the tools that use shared fragments.\n`#import` comments stay unsupported because the GraphQL specification treats\ncomments like whitespace.\n\n### The size of a document\n\nGATool limits what it reads from a file, and the API limits what it accepts in a\nrequest. The two are set in different places, so they can disagree.\n\n**What GATool reads.** An operation file, a shared fragment file and the schema\nfile are your own text, so GATool reads them however long they are. One limit\nstays on an operation file and a fragment file: selection sets nested 165 deep,\nbecause a document nested far deeper runs the thread that prints it out of\nstack. A file past that depth stops startup with a problem that names the limit.\nThe limit is fixed in this release, and a property cannot change it.\n\n**What the API reads.** The API applies limits of its own to each request, and\nit refuses a call whose document passes them. GraphQL's introspection describes\ntypes and leaves request limits out, so GATool cannot read them from the API.\nYou state them under `gatool.api.request-limits`, and startup and the CI check\nwarn about a tool whose document passes one:\n\n| Property | Default, which is what graphql-java reads of a request |\n| --- | --- |\n| `gatool.api.request-limits.max-characters` | 1,048,576 |\n| `gatool.api.request-limits.max-tokens` | 15,000 |\n| `gatool.api.request-limits.max-whitespace-tokens` | 200,000 |\n\n```yaml\ngatool:\n  api:\n    request-limits:\n      max-tokens: 5000\n```\n\nSet each to your API limit. The defaults hold for an API built on\ngraphql-java that left its parser options alone. Apollo Router stops at 15,000\ntokens by default as well, and it counts the ignored tokens, such as commas,\namong them, so its limit is reached sooner. A value below 1 leaves that size\nunchecked. The properties decide what GATool warns about. The API keeps\napplying its own limits whatever they say, so a value above the limit of the\nAPI silences a warning about a call the API refuses.\n\nThe document counted is the one GATool sends: the operation as graphql-java\nprints it, with the fragments of every shared file it spreads. The printer\nindents each field, so a deeply nested document gains whitespace the file did\nnot hold. The tool is served either way, and the way out is to select less or\nto split the operation.\n\n**What a model writes.** A document a model writes for `executeGraphql` is read\nunder graphql-java's limits for a request, nesting included, and under three\nlimits you set: `max-depth`, `max-fields` and `max-aliases` under\n`gatool.dev.experimental.dynamic-operations`. They protect the API from a\ndocument that reached it without review, so set them at or below the limits of\nthe API.\n\n### Reading the schema from a registry\n\n`gatool.api.schema.location` is a Spring `Resource`, so the value decides where\nthe schema comes from. `classpath:` and `file:` read a file in the jar or on a\nmounted volume. An `http` or `https` URL is fetched at startup by GATool itself,\nbecause a registry serves the schema with a key in a header and Spring's own\n`UrlResource` cannot send one. `s3:\u002F\u002F`, `gs:\u002F\u002F` and `azure-blob:\u002F\u002F` arrive\nthrough Spring Cloud AWS, GCP and Azure, which register those protocols with the\nsame resource loader, so a team adds that starter and writes the URL.\n\n[GraphQL Hive](https:\u002F\u002Fthe-guild.dev\u002Fgraphql\u002Fhive\u002Fdocs\u002Fhigh-availability-cdn)\nserves the SDL of a target from its CDN, with the key in `X-Hive-CDN-Key`:\n\n```yaml\ngatool:\n  api:\n    schema:\n      location: https:\u002F\u002Fcdn.graphql-hive.com\u002Fartifacts\u002Fv1\u002F${HIVE_TARGET_ID}\u002Fsdl\n      header-name: X-Hive-CDN-Key\n      header-value: ${HIVE_CDN_KEY}\n```\n\nThe key stays out of every log line, and startup names the URL without its\nuserinfo and query. A value holding a line break, which a secret read from a\nfile often ends in, stops startup naming the property, and so does a header\nname outside RFC 9110's token characters; a space inside the value, as in\n`Bearer \u003Ckey>`, is accepted. GATool follows up to five redirects itself and\nsends the key to the configured origin alone: a `Location` on the same scheme,\nhost and port gets it, and any other host, such as the pre-signed storage URL\nHive's CDN answers with a 404, and it is fetched without it. A redirect loop or a sixth hop\nstops startup naming the URL, and `spring.http.clients.redirects` does not\napply to this request. The body is bounded by `gatool.api.schema.max-size`,\n10MB by default, so a schema larger than the response cap of a tool call is\nfetched while that cap stays where the deployment set it. A schema above the\nbound stops startup naming the property. GATool fills whichever of\n`spring.http.clients.connect-timeout` and `read-timeout` the application left\nunset, with 3 seconds to connect and 15 for an answer, which startup says at\nINFO, as it does for the API.\nHive's CDN answers with an `ETag`, which\nGATool keeps on the first line of the cached copy under\n`gatool.api.schema.cache-directory`. The default is `schema`, inside a folder\nnamed `gatool-` and the account the JVM runs as, under the JVM's temporary\ndirectory (`java.io.tmpdir`). The copy is written after\nevery operation file validated against the fetched schema, so it holds the last\nschema that validated, and a fetch that breaks an operation stops startup and\nleaves the copy alone. The next startup sends\n`If-None-Match`, a `304` reuses the copy, and a registry that cannot be reached,\nor that answers `5xx`, starts the application on the copy with a warning naming\nits age. A `4xx` such as `401` names a setting to fix, so it stops startup even\nwith a copy on disk. The directory is configurable: a team that wants the copy\nto outlive the temporary directory, or to live on a persistent volume, sets the\nproperty to a path of its own. A blank value fetches at every startup and stops\nwhen the fetch fails.\n\n**The default folder is checked before it is used.** The temporary directory of a\nLinux host is shared by every account on it, so another account can make\nGATool's folder first and put a schema into it, and the descriptions of a schema\nread from there reach the model as tool text. GATool makes the folder for its\nowner alone, and it uses the folder only while the account it runs as owns it\nand group and others cannot write to it. A folder that fails is left unread and\nunwritten, and startup warns with the reason: the schema is then fetched at\nevery startup, and a startup while the registry is down stops. A directory you\nconfigure is used as it is, because a volume mounted into a container is often\nowned by root and writable by a group, and it is yours to secure.\n\nApollo GraphOS and WunderGraph Cosmo hand the schema to their own command line\ntools: `rover supergraph fetch` and `rover graph fetch` write the supergraph or\nthe API schema, and `wgc federated-graph fetch-schema` writes the router schema\nof a federated graph, or the client schema with `--client-schema`. Package the\nAPI or client schema: a supergraph or router schema carries fields marked\n`@inaccessible`, which pass validation at startup and which the router refuses\nat call time, and GATool reads the file as written until it derives the API\nschema itself. A build step that runs one of them and packages the file gives\nGATool a `classpath:` or `file:` location, and a team that publishes the file to a\nbucket or behind its own URL uses the protocols above.\n\n### Getting started without writing operation files\n\nA development switch, off by default, that startup warns about on every boot\nwhile it is on, gives you tools from the schema alone:\n\n```yaml\ngatool:\n  dev:\n    experimental:\n      generate-tools: all-root-queries    # or all-root-queries-and-mutations\n      generated-selection-depth: 1        # 1 to 5\n      generate-tools-for-deprecated-root-fields: true\n      generated-operations-include-deprecated-fields: true\n```\n\nEvery root field becomes one tool: the field name becomes the tool name, its\narguments become the tool's arguments with their defaults, and the field's own\nschema description becomes the tool description. The selection set takes the\nleaves of the type the field returns, so depth `1` selects the scalars one level\nin. A wrapper costs one level per hop, so a Relay connection needs `3` to reach\nnode data: the connection, its edges, then the node. At `2` you get cursors and\npage counts, and the node data stays out.\nA union selects `__typename` and one inline fragment per member; an interface\nselects `__typename` and its own fields.\n\nThe generator leaves out a root field whose type expands to an empty selection\nwithin the depth, and one whose generated operation is longer than 20,000\ncharacters. Startup names each one it skipped, and tells you whether a deeper\nsetting would reach the first kind and to lower the depth for the second.\nInside a selection, a field that would reach a type already on the path is\nleft out, and the rest of the selection stays. A required argument of a\nroot field becomes a required argument of the tool. A field inside the\nselection that demands an argument is left out of the selection, because the\ngenerator cannot supply its value. A root field you asked to drop with the deprecation property below\nleaves quietly, since you asked for it.\n\n**Deprecated fields stay in until you say otherwise.** Both deprecation\nproperties default to `true`, which is what the generator has always done: a root\nfield your schema marks `@deprecated` becomes a tool, its deprecation goes into\nthe tool description where the model reads it, and a deprecated field takes its\nplace in a generated selection set. Set\n`generate-tools-for-deprecated-root-fields` to `false` and that root field is left\nout of the generation entirely. Set\n`generated-operations-include-deprecated-fields` to `false` and a deprecated\nfield stays out of a generated selection, judged by the declaration of the type\nbeing selected, which is one way to trim what a tool brings back. A root field\nwhose type offers deprecated fields alone then has an empty selection set and\nloses its tool. Startup says which setting reaches it, the depth or this property,\nor that only both together do.\n\n**An operation file wins.** A root field your files already select keeps your\noperation, so you can generate the lot, keep the three you want, and write those\nas files while the rest stay generated.\n\n**Why it lives under `dev.experimental`.** GATool's product is the trusted documents:\nThe operation files state which operations exist, a pull request reviews each one,\nand the model chooses from that list. This publishes the whole root of your API to\na model instead, which is what trusted documents exist to prevent, and it may\nchange in any release. Startup says so on every boot while it is on. The generated\ntext goes through the same parser, validator, and catalog as a file you wrote, so\na generated tool behaves as a tool from a file does.\n\n**The three-step layer needs two dependencies.** With\n`gatool.dev.experimental.generate-tools` set to `dynamic-three-step`, GATool\npublishes `searchSchema`, `introspectType` and `executeGraphql`, and the search\nranks schema coordinates with Lucene. Neither starter carries Lucene, because the\nlayer is off by default, and the two jars are 6.3 MB together (lucene-core 4.6 MB,\nlucene-analysis-common 1.7 MB), so add both yourself:\n\n```xml\n\u003Cdependency>\n    \u003CgroupId>org.apache.lucene\u003C\u002FgroupId>\n    \u003CartifactId>lucene-core\u003C\u002FartifactId>\n    \u003Cversion>10.3.2\u003C\u002Fversion>\n\u003C\u002Fdependency>\n\u003Cdependency>\n    \u003CgroupId>org.apache.lucene\u003C\u002FgroupId>\n    \u003CartifactId>lucene-analysis-common\u003C\u002FartifactId>\n    \u003Cversion>10.3.2\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n\nGATool builds against 10.3.2. Startup stops and names each missing jar when the\nlayer is on, and one of the two is absent. lucene-core holds the index, and\nlucene-analysis-common splits an identifier such as `topRatedMovies` into words\nand stems them, which is what lets a question in plain words find a field on a\nschema without descriptions. An application that publishes a `SchemaSearch`\nbean of its own ranks with that bean, and both jars stay out of its build. The\nbean builds its entries with `SchemaCorpus.of`, from a schema the application\nreads on its own. `GAToolCatalog` holds the tools alone, without the schema, and a `SchemaSearch`\nbean that injects the catalog makes a cycle Spring reports at startup, because\nthe catalog depends on the search bean. An operation file whose tool would take one of the three names stops startup,\nnaming the file and the property; give that operation another name with\n`@gatool(name:)`. A search hit on a field an interface declares says so and\nnames an implementation to select it on, `introspectType` lists an interface's\nimplementations in a trailing comment, and its description names the query\nroot, and the mutation root while `allow-mutations` is on.\n\nA deprecated field, argument, enum value or input field that\n`gatool.dev.experimental.dynamic-operations.include-deprecated-fields=false`\nhides from `searchSchema` and `introspectType` still executes when the model\nwrites it into a document, because the property saves tokens and is not an\naccess control; a field a caller must not reach stays out of the schema the API\nserves. A federated subgraph publishes `Query._service { sdl }`, which lets a\nmodel read the whole SDL through `executeGraphql`, so the layer publishes what\nthe API publishes, with one exception: a document selecting `__schema` or\n`__type` at any depth is refused by `executeGraphql`, which sends the model to\nthe two schema tools. The three limits on the document it sends, `max-depth`,\n`max-fields` and `max-aliases`, count the document's syntax; argument values,\nlist sizes and resolver cost stay with the API's own demand control, and the\ntwo response caps apply after the API computes the result.\n\n## Configuration\n\n| Property | What it does |\n| --- | --- |\n| `gatool.api.url` | The GraphQL API every document goes to. A redirect from it is left unfollowed and reported with its status, so name the URL the API answers at |\n| `gatool.api.schema.location` | The schema that operations validate against: a `classpath:` or `file:` resource, an `https:\u002F\u002F` URL, or a protocol a Spring Cloud module registers |\n| `gatool.api.schema.header-name` | The header that carries a registry key when the location is an `http` or `https` URL |\n| `gatool.api.schema.header-value` | Its value, kept in the environment |\n| `gatool.api.schema.cache-directory` | Where a fetched schema and its `ETag` are kept, by default `schema` inside `gatool-\u003Caccount>` under the JVM's temporary directory (`java.io.tmpdir`), where `\u003Caccount>` is the account the JVM runs as; GATool makes the default folder for its owner alone and uses it only while that account owns it and group and others cannot write to it; a path of your own keeps the copy on a persistent volume and is used as it is, and blank fetches at every startup |\n| `gatool.api.credentials.strategy` | How GATool authenticates to that API: unset sends each call without a credential, `static-header` sends the header below, `client-credentials` obtains GATool's own token, `token-exchange` exchanges the caller's |\n| `gatool.api.credentials.header-name` | The header that carries the credential, such as `Authorization` or `X-API-Key` |\n| `gatool.api.credentials.header-value` | Its value, such as a bearer token, kept in the environment |\n| `gatool.api.credentials.client-registration-id` | The Spring Boot client registration the two OAuth2 strategies authenticate through |\n| `gatool.api.credentials.audience` | The audience token exchange asks the issuer for, which the API validates |\n| `gatool.api.credentials.resource` | The resource token exchange names to the issuer, sent when set |\n| `gatool.mcp.operations.locations` | Where the MCP operation files live, `optional:classpath*:gatool\u002Fmcp\u002F` by default. Naming a folder replaces that default, so list it again beside a new folder to keep the tools already there. A `classpath*:` location inside a jar needs directory entries in that jar, which Maven and Gradle write, because Spring lists a jar's folder through those entries |\n| `gatool.in-process.operations.locations` | Where the in-process operation files live, `optional:classpath*:gatool\u002Fin-process\u002F` by default, replaced the same way and with the same jar rule |\n| `gatool.naming.strategy` | `camel-case`, `snake-case` or `as-written` |\n| `gatool.results.max-characters` | Largest result a tool returns, 60000 characters by default. The count is Java's `String.length()`, which counts UTF-16 code units, so a character outside the Basic Multilingual Plane, such as an emoji, counts as two |\n| `gatool.results.publish-output-schema` | Whether tools publish an output schema and structured content; the three dynamic tools are published without one either way |\n| `gatool.results.partial-results-as-success` | Whether a response holding both data and errors counts as a success, off by default |\n| `gatool.results.scalar-schemas.\u003CName>` | The JSON Schema fragment the output schema publishes for a custom scalar that returns another form than it accepts, in place of what it reuses from `gatool.inputs.scalar-schemas.\u003CName>` |\n| `gatool.api.request-limits.max-characters` | Characters you expect the API to read of a document, 1,048,576 by default, which is what graphql-java reads of a request; startup and the CI check warn about a tool whose document holds more, and the tool is served all the same; a value below 1 leaves the size unchecked |\n| `gatool.api.request-limits.max-tokens` | Tokens you expect the API to read of a document, 15,000 by default; the warning and the value below 1 work as for the characters |\n| `gatool.api.request-limits.max-whitespace-tokens` | Whitespace tokens you expect the API to read of a document, 200,000 by default, counted in the printed document GATool sends; the warning and the value below 1 work as for the characters |\n| `gatool.api.max-response-size` | Largest response GATool reads from the API, 1MB by default. The value determines the heap size for one in-flight call, which \"Running in a container\" sizes. A value in bytes below `gatool.results.max-characters` makes the cap refuse every result the result limit would have allowed, and startup warns naming both |\n| `gatool.api.schema.max-size` | Largest schema GATool fetches from a URL, 10MB by default; a schema above it stops startup naming the property. The bound is the schema's own, so a public schema of a few megabytes is fetched while `gatool.api.max-response-size` stays where the deployment set it |\n| `gatool.mcp.rate-limit.calls-per-minute` | Calls one caller makes to one tool each minute, 60 by default. The caller is the token's subject once the endpoint is secured, or the token's fingerprint where an application's own converter leaves the name blank, which is the key the session binding uses, and the client address while `allow-mcp-calls-without-authentication` is on; it is read through the `SecurityContextHolderStrategy` bean an application declares, so a strategy of the application's own keeps the count per caller. Behind a proxy that address is the proxy's, so set `server.forward-headers-strategy=native` with `server.tomcat.remoteip.internal-proxies` naming the proxy, which replaces a default that covers every private address range; `framework` trusts the forwarded headers every client sends, so a caller could then send a different address on every call and escape the count |\n| `gatool.mcp.rate-limit.max-tracked-pairs` | Most caller and tool pairs the limiter counts at once, 100,000 by default; each pair holds a bucket of a few hundred bytes for a minute after its last call. Above it, the limiter drops a live pair's bucket for each new one, and that caller starts with a fresh allowance; the Micrometer counter `gatool.rate-limit.evictions` counts those drops, and the log warns once a minute, naming the property. Set it above the pairs active within a minute |\n| `gatool.mcp.transport.max-request-body-size` | Largest request body the MCP endpoint reads, 256KB by default |\n| `gatool.mcp.transport.allowed-origins` | The origins the endpoint accepts in an `Origin` header, empty by default, so a request carrying the header is refused with `403` until its origin is listed; a request without the header is accepted. Each entry is a serialized origin, `scheme:\u002F\u002Fhost[:port]`: the scheme and the host are compared case-insensitively, one trailing slash is ignored, and an entry of another shape stops startup. CORS stays the application's: a browser client also needs a `CorsConfigurationSource` bean of the application's own, such as a `UrlBasedCorsConfigurationSource`, which is what Spring Security's `cors()` reads |\n| `gatool.mcp.sessions.max-count` | Most stateful sessions the server keeps at once, 1000 by default |\n| `gatool.mcp.sessions.max-count-per-caller` | Most stateful sessions one caller may hold at once, 100 by default; 0 turns it off |\n| `gatool.mcp.sessions.idle-timeout` | How long a stateful session may stay idle before eviction, 30 minutes by default; `spring.ai.mcp.server.streamable-http.keep-alive-interval` has to be shorter than it, and startup stops naming both otherwise |\n| `gatool.mcp.security.baseline-scopes` | Scopes every MCP call needs, published in the metadata and every `401` |\n| `gatool.mcp.security.resource` | The canonical resource URI the metadata publishes; unset publishes the request's URL |\n| `gatool.mcp.stdio.granted-scopes` | The scopes the process that started a stdio server holds, which tools requiring scopes are checked against |\n| `gatool.mcp.stdio.log-to-stderr` | Whether a stdio server writes its log to stderr, on by default. stderr carries WARN and above until `logging.threshold.console` sets another threshold, and the log is written without making the server wait, so a host that leaves stderr unread loses lines while the server keeps answering, and a WARN line says how many once lines get through again. It applies on Logback, while the application leaves `logging.console.enabled` unset and the logging configuration to Spring Boot's defaults. On Log4j2 startup, it prints a one-line message to stderr that the log is lost, while the application leaves the log file and `logging.config` unset. On `java.util.logging` a log file leaves the stderr log on, and the application's own `logging.config` is what changes it |\n| `gatool.mcp.stdio.elicitation` | Whether a stdio server runs each tool call on the MCP SDK's thread pool so a tool marked `elicit` can ask the user, off by default. On, GATool's reader-thread customizer backs off and the deployment accepts the race of java-sdk issue 686 until the SDK release after 2.0.1 ships its repair; startup warns once. On, startup also stops in a servlet application that serves stdio, and where an application's own customizer sets `immediateExecution(true)`. A value spelled `off` stops startup: Spring Boot binds it as false, so the startup check requires the `immediateExecution(true)` that GATool's reader-thread customizer sets, and the customizer's condition compares the written value with `false` and leaves the customizer out; write `false` |\n| `gatool.elicitation.declined-answer` | The sentence the model reads after the user declined, with `{tool}` for the tool name. The default is in [Asking the user before a call](#asking-the-user-before-a-call) |\n| `gatool.elicitation.cancelled-answer` | The sentence the model reads after the user dismissed the dialog, with `{tool}` for the tool name. The default is in [Asking the user before a call](#asking-the-user-before-a-call) |\n| `gatool.elicitation.ignore-where-unsupported` | Whether a deployment that cannot ask, the stateless server, the in-process starter and stdio without `gatool.mcp.stdio.elicitation`, starts with the tools marked `elicit` running without asking, off by default. Off, startup fails and names the tools |\n| `gatool.inputs.scalar-schemas.\u003CName>` | The JSON Schema fragment to publish for a custom scalar |\n| `gatool.inputs.send-explicit-nulls` | Whether a null argument for a variable that declares a default reaches the GraphQL API as an explicit null, off by default; a null for a variable without a default is sent either way |\n| `gatool.dev.experimental.generate-tools` | Which tools to write from the schema: `none` by default, `all-root-queries`, `all-root-queries-and-mutations` or `dynamic-three-step` |\n| `gatool.dev.experimental.generate-tools-for-deprecated-root-fields` | Whether a deprecated root field becomes a tool |\n| `gatool.dev.experimental.generated-operations-include-deprecated-fields` | Whether a deprecated field is selected |\n| `gatool.dev.experimental.generated-selection-depth` | How many object levels a generated selection expands |\n| `gatool.dev.experimental.dynamic-operations.corpus-format` | How each schema coordinate is written for the search index, `sdl` by default; `gloss` is one sentence and `raw` the coordinate alone |\n| `gatool.dev.experimental.dynamic-operations.search-backend` | What ranks a search, `bm25` by default; `embedding` uses the application's `EmbeddingModel` bean and startup stops without one |\n| `gatool.dev.experimental.dynamic-operations.search-token-budget` | Tokens of search results one `searchSchema` call returns, 2000 by default, a token counted as four characters of the text and the hint; a best match above the budget is named with its cost so the model can read it with `introspectType` |\n| `gatool.dev.experimental.dynamic-operations.ranked-hits` | Coordinates a search ranks before the budget cuts the list, 50 by default |\n| `gatool.dev.experimental.dynamic-operations.allow-mutations` | Whether a mutation the model wrote runs, off by default; while off, the mutation root and the types only it reaches stay out of `searchSchema`, `introspectType` and the hints |\n| `gatool.dev.experimental.dynamic-operations.include-deprecated-fields` | Whether a deprecated field, argument, enum value or input field is searchable, readable and used as a step in a hint, off by default; while on, each is written with the reason the schema gives |\n| `gatool.dev.experimental.dynamic-operations.validate-only` | Whether `executeGraphql` returns the validated operation for a person to run, without calling the API, off by default |\n| `gatool.dev.experimental.dynamic-operations.search-schema-description`, `.introspect-type-description` and `.execute-graphql-description` | The whole description of one of the three tools, replacing the text GATool writes, sentences GATool generates from the schema and the settings included. Unset by default, and a blank value keeps GATool's text |\n| `gatool.dev.experimental.dynamic-operations.max-depth` | Deepest field nesting `executeGraphql` sends, 15 by default; 0 switches the check off |\n| `gatool.dev.experimental.dynamic-operations.max-fields` | Most field selections `executeGraphql` sends, spreads counted where spread, 500 by default; 0 switches the check off, and graphql-java's own ceiling of 100,000 selections still applies |\n| `gatool.dev.experimental.dynamic-operations.max-aliases` | Most aliased fields `executeGraphql` sends, 30 by default; 0 switches the check off |\n| `gatool.dev.experimental.dynamic-operations.question-prefix` | Text put in front of a question before it is embedded, empty by default; joined as it is, so quote the value in YAML to keep a trailing space |\n| `gatool.dev.experimental.dynamic-operations.field-prefix` | Text put in front of each schema field before it is embedded, empty by default, joined the same way |\n| `gatool.dev.experimental.dynamic-operations.embed-batch-size` | Schema fields sent to the embedding model in one call, 128 by default |\n| `gatool.dev.experimental.dynamic-operations.vector-cache-directory` | Where embedded fields are cached so a schema is embedded once, by default `vectors` inside `gatool-\u003Caccount>` under the JVM's temporary directory (`java.io.tmpdir`), checked the way the schema cache's default folder is; a path of your own keeps the vectors on a persistent volume and is used as it is, and blank embeds at every startup; the files are written through a temporary file and an atomic rename, and a cache an earlier build wrote is embedded once more, because the key format changed |\n| `gatool.dev.experimental.dynamic-operations.required-scopes` | The scopes a caller needs for the three dynamic tools on top of the baseline, all of them; required under a shared credential |\n| `gatool.observations.include-content` | Whether arguments and results join the `gatool.call` observation as high-cardinality values, off by default |\n\nEvery property has Javadoc, so an IDE explains it while you type. Each one says\nwhat it does in a sentence; what a setting costs is here.\n\nA call to a remote API is bounded by `spring.http.clients.connect-timeout` and\n`spring.http.clients.read-timeout`, which Spring Boot's `RestClient` builder\ncarries into the client GATool uses. GATool fills whichever of the two the\napplication left unset, 3 seconds to connect and 15 for an answer, and says so\nat INFO, because a call to an API that stops answering would otherwise hold\nthe thread until the socket closes. Under `client-credentials` and\n`token-exchange` the request to the issuer's token endpoint waits under the\nsame two deadlines. When the API takes longer to answer a query\nthan the read timeout, before the status arrives or inside the body, the model\nreads that, with the deadline and the property that sets it, and is asked for\nfewer fields or a smaller page, because the same call is likely to take as long\nagain. When the connection did not open, the\nmodel reads that the call did not run and that a later call may succeed, and\nfor any other transport failure that GATool cannot tell whether the call ran.\nA mutation reads the same account of how far the call got, and after each of\nthe three it is asked to read the current state before sending the call again.\nThe model's sentence and the operator's line open with the same words. The\noperator reads a WARN line for each such call, of a query\nor a mutation, which says how far the call got and ends with the cause: the\ntool `could not reach the GraphQL API`, the API\n`took longer to answer than the read timeout of 15 seconds`, or the tool\n`failed in transport while calling the GraphQL API, and the cause does not say whether the call ran`.\nThe stack is written at DEBUG. An embedded API runs in the same JVM, and this\nrelease leaves that call without a deadline.\n\nThe MCP Java SDK client and Spring AI's MCP client wait 20 seconds for a tool\ncall by default, and their clock starts before GATool's does. Keep\n`spring.http.clients.read-timeout` below the request timeout of the client\nthat calls the server, or raise `spring.ai.mcp.client.request-timeout`. A\nclient that reaches its own deadline first gives up on the call, and the model\nthen reads the client's timeout message instead of GATool's sentence. After a\nmutation, GATool's sentence is the one that asks the model to read the current\nstate before it sends the write again.\n\nGATool builds the request factory of that client from the application's\n`ClientHttpRequestFactoryBuilder` bean and `spring.http.clients.*`, and startup\nnames the builder at INFO. The headers and interceptors a `RestClientCustomizer`\nsets reach every request GATool sends, and startup names the customizer beans;\na request factory the customizer installs stays on the application's own\nclients, because GATool's factory carries the response size cap and leaves\nredirects unfollowed. Without a builder bean,\n`ClientHttpRequestFactoryBuilder.detect()` prefers Apache HttpClient 5 and\nJetty over the JDK client, so `httpclient5` on the classpath for any reason\nmoves GATool onto Apache's pool of 5 connections per route and 25 in all,\nmeasured at about 48 calls per second against 398 with the JDK client, and\nstartup warns on that builder.\n`spring.http.clients.imperative.factory=jdk` selects the JDK client, and a\n`ClientHttpRequestFactoryBuilder` bean built from\n`ClientHttpRequestFactoryBuilder.httpComponents().withConnectionManagerCustomizer(...)`\nraises both sizes.\n\nA proxy reaches GATool's client through that same builder bean. The bean\nreplaces the builder Spring Boot declares, so every client the application\nbuilds from Spring Boot's builder goes through the proxy as well. A factory a\n`RestClientCustomizer` installs stays on the application's own clients, so a\nproxy set only there does not reach GATool's calls:\n\n```java\n@Bean\nClientHttpRequestFactoryBuilder\u003C?> gatoolRequestFactoryBuilder() {\n    return ClientHttpRequestFactoryBuilder.jdk()\n            .withProxySelector(ProxySelector.of(new InetSocketAddress(\"proxy.example.com\", 8080)));\n}\n```\n\nMutual TLS reaches GATool's client the same way, through\n`spring.http.clients.ssl.bundle`, which GATool reads with the rest of\n`spring.http.clients.*`. A `RestClientCustomizer`'s factory stays on the\napplication's own clients here as well:\n\n```yaml\nspring:\n  ssl:\n    bundle:\n      jks:\n        mtls:\n          keystore:\n            location: classpath:client-keystore.p12\n            password: ${KEYSTORE_PASSWORD}\n          truststore:\n            location: classpath:client-truststore.p12\n            password: ${TRUSTSTORE_PASSWORD}\n  http:\n    clients:\n      ssl:\n        bundle: mtls\n```\n\nIn embedded mode, the document runs on the application's `WebGraphQlHandler`\nbean, or on one GATool builds from the `ExecutionGraphQlService` with the\napplication's `WebGraphQlInterceptor` beans, so the interceptors apply in every\napplication type, including non-web ones, and startup names them. That call\nruns past the servlet filter chain and every URL rule on\n`spring.graphql.http.path`, so the controls on it are the MCP endpoint's scopes,\nthose interceptor beans and method security in the resolvers.\n\nEvery MCP tool call is a Micrometer observation named `gatool.call`, with\n`gatool.call.name` and `gatool.operation.type` (`query` or `mutation`) as\nlow-cardinality tags and `gatool.call.outcome` as one of\n`success`, `graphql-errors`, `api-refused`, `credential-unavailable`,\n`response-too-large`, `result-too-large`, `tool-error`, `rate-limited`,\n`insufficient-scope`, `off-request-thread`, `elicitation-unsupported`,\n`elicitation-declined`, `elicitation-cancelled`, `elicitation-timeout` and\n`elicitation-failed`. For a tool that asks the user, the observation spans the\nwait, so its duration includes the user's thinking time. An\nanswer the operator has to act on reaches the log at WARN: a `5xx`, and a `2xx`\nwithout a GraphQL response, are written once per tool per minute, and the next\nline says how many such answers were left out since the last one; a refused\ncredential and a redirect are written on every call. A `4xx` stays at DEBUG,\nbecause the model reads it and can act on it: it corrects the call, or sends\nthe same one again after a `408`, a `425` or a `429`, where it reads that a\nlater call may succeed, as it does for a `5xx`. A confirmation that fails\nreaches the log at ERROR with its exception, and the model reads only that the\nconfirmation failed. A confirmation that times out reaches the log at WARN in\none line that names the tool and the request timeout, with `{tool}` and\n`{timeout}` written as in\n[Asking the user before a call](#asking-the-user-before-a-call):\n\n```\nThe user did not answer the confirmation for {tool} within {timeout} (spring.ai.mcp.server.request-timeout), so the API was not called, and the call held its thread for that long.\n```\n\nThat line is also the trace of a client that disconne","GATool 是一个 Spring Boot Starter 工具库，用于将预审的 GraphQL 操作文件（.graphql）自动注册为 AI 代理可调用的标准化工具。其核心功能包括：基于文件注释自动生成工具描述、从变量声明推导输入 Schema、严格校验操作与 GraphQL Schema 的一致性，并支持通过 MCP 协议或 Spring AI 内部调用两种集成模式。所有 GraphQL 文档均在构建时验证，确保仅允许白名单内的可信查询执行，避免运行时注入风险。适用于需要将现有 GraphQL API 安全、可控地暴露给 LLM 代理（如 RAG、自动化工作流）的企业级 Java 微服务场景。",2,"2026-11-24 04:33:23","CREATED_QUERY"]