Filtering exposed types

When to use this

Your module has many public classes but you only want a subset callable remotely — for security, API surface control, or MCP exposure.

Prerequisites

  • Installed GG
  • Know the fully qualified type names (FQN) of types to expose

Filtering exposed types with --types — full module vs public facade only in UGM

Pass --types with a facade FQN so Vision and generated Grafts expose only the surface you intend.


Steps

1. Identify type names

Examples by language:

LanguageFQN example
C#MyCompany.Api.OrderFacade
Javacom.mycompany.api.OrderFacade
Pythonmypackage.api.order_facade

2. Pass --types to GG

Comma-separated list, no spaces unless part of the name:

./gg ./MyLib.dll --types MyCompany.Api.OrderFacade,MyCompany.Api.CatalogFacade --port 8888

Only public methods on the listed types are included in the Unified Graft Model and reachable through Grafts and MCP.

Create a single static facade class with static methods that delegate to internal services. Expose only that facade:

./gg ./MyLib.dll --types MyCompany.Api.PublicFacade --port 8888

This keeps internal types private by language visibility rules — they never enter the UGM.


Verify it works

  • Graftcode Vision lists only the filtered types
  • Generated Graft contains only methods from those types
  • Internal types are not callable remotely

Common mistakes

MistakeFix
Wrong FQNCopy exact namespace + class from Vision or IDE
Expecting namespace-level filterUse --types per class; --namespaces is not enabled in current GG
Too many types exposedPrefer one facade class

See also