create_tenant_provider_policy
Define policies for tenant providers by specifying conditions, audience, and descriptions to manage access and permissions effectively within the UseGrant MCP Server.
Instructions
Create a new policy for a tenant provider
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| audience | Yes | The audience of the tenant provider policy | |
| conditions | Yes | The conditions of the tenant provider policy | |
| description | Yes | The description of the tenant provider policy | |
| name | Yes | The name of the tenant provider policy | |
| providerId | Yes | The ID of the tenant provider | |
| tenantId | Yes | The ID of the tenant |
Implementation Reference
- src/index.ts:342-347 (handler)The handler function for the 'create_tenant_provider_policy' tool. It extracts tenantId, providerId, and payload from args, calls usegrant.createTenantProviderPolicy, and returns the policy as JSON text content.async ({ tenantId, providerId, ...payload }) => { const policy = await usegrant.createTenantProviderPolicy(tenantId, providerId, payload); return { content: [{ type: 'text', text: JSON.stringify(policy, null, 2) }], }; },
- src/index.ts:337-341 (schema)Input schema for the tool, combining TenantIdSchema, TenantProviderIdSchema, and the shape from CreateTenantProviderPolicySchema.{ tenantId: UgSchema.TenantIdSchema, providerId: UgSchema.TenantProviderIdSchema, ...UgSchema.CreateTenantProviderPolicySchema.shape, },
- src/index.ts:334-348 (registration)Registration of the 'create_tenant_provider_policy' tool using server.tool(), including name, description, input schema, and handler function.server.tool( 'create_tenant_provider_policy', 'Create a new policy for a tenant provider', { tenantId: UgSchema.TenantIdSchema, providerId: UgSchema.TenantProviderIdSchema, ...UgSchema.CreateTenantProviderPolicySchema.shape, }, async ({ tenantId, providerId, ...payload }) => { const policy = await usegrant.createTenantProviderPolicy(tenantId, providerId, payload); return { content: [{ type: 'text', text: JSON.stringify(policy, null, 2) }], }; }, );