Struct McpToolCategory
- Namespace
- MailFathom.Mcp.Tools.Categories
- Assembly
- MailFathom.Mcp.dll
One kind of thing this surface offers, which a deployment may name to publish that kind and no other.
public readonly record struct McpToolCategory : IEquatable<McpToolCategory>
- Implements
- Inherited Members
Remarks
The type is a closed enumeration of values rather than a C# enum, because the name is the identity and it travels outside this process: an operator writes it in configuration and a client writes it in the header McpToolCategoryHeader defines. A member's ordinal would mean nothing to either, and its C# name has to be free to change without moving what an operator has already written.
A category names what a tool is for rather than which project implements it or which permission reaches it. The two questions are separate on purpose: a grant decides what a caller may do, and a category decides what this endpoint offers at all. Neither is derivable from the other — the contact book is read under one permission and written under a second while both belong to one category, and a deployment publishing the mailbox alone withholds both from a caller granted everything.
The set is closed so that a category naming nothing is unknown rather than new: startup refuses a misspelling in configuration instead of narrowing an endpoint to a name no tool carries, and a client asking for one is answered with the selection it would have had. Adding a member is a deliberate change here, made when the tools it groups exist, and it is a change to the configuration schema as much as to this file.
Nothing serializes a category, which is why the type carries no JSON converter: it is parsed from configuration and from a request header through TryParse(string?, out McpToolCategory), and no tool descriptor, result, or record publishes one. Being a struct, default is reachable and is not a category; it reports itself through IsSpecified and is refused by Of(IEnumerable<McpToolCategory>), which is the one place a set of them is composed.
Properties
- All
Gets every published category.
- Answering
Gets the category of the tool that answers a question from mail content by sending it to a model provider.
- Contacts
Gets the category of the tools that read and write the contact book.
- Drafts
Gets the category of the tools that compose, amend, and discard a message that is never sent.
- Flags
Gets the category of the tool that changes the flags and keywords on mail this deployment holds.
- IsSpecified
Gets whether this value names a published category rather than the unusable struct default.
- Mailbox
Gets the category of the tools that read the local mailbox copy: the accounts, the timeline, one email's content, and search.
- Name
Gets the published name, which is what an operator writes and what a client names in a header.
- Sending
Gets the category of the tools that send mail from an account this deployment holds, of the two over a send that was queued, and of dispatching a draft.
Methods
- PublishedNames()
Reports every published name, in declaration order, for a failure that has to say what is accepted.
- ToString()
Returns the fully qualified type name of this instance.
- TryParse(string?, out McpToolCategory)
Parses an operator-supplied or client-supplied category name.