microsoft/semantic-kernel · error · KernelException

No '{fullTypeName}' message type is found while resolving da

Error message

No '{fullTypeName}' message type is found while resolving data contracts for the '{methodName}' method.

What it means

Thrown by CreateDataContract when no message type in `allMessageTypes` matches the requested `fullTypeName` (or the package-stripped `typeName`). The runner resolves each method's request/response message type by name against the set parsed from the .proto; a miss means the .proto references a message type it does not define or import.

Source

Thrown at dotnet/src/Functions/Functions.Grpc/Protobuf/ProtoDocumentParser.cs:91

    /// </summary>
    /// <param name="allMessageTypes">Existing ,message types declared in .proto file.</param>
    /// <param name="messageTypeName">Message type to create the data contract for.</param>
    /// <param name="package">The .proto file 'package' specifier.</param>
    /// <param name="methodName">The method to create data contract for.</param>
    /// <returns>The operation data contract.</returns>
    private GrpcOperationDataContractType CreateDataContract(IList<DescriptorProto> allMessageTypes, string messageTypeName, string package, string methodName)
    {
        var fullTypeName = messageTypeName.TrimStart('.');

        var typeName = fullTypeName;

        if (!string.IsNullOrEmpty(package))
        {
            typeName = fullTypeName.Replace($"{package}.", "");
        }

        var messageType = allMessageTypes.SingleOrDefault(mt => mt.Name == fullTypeName || mt.Name == typeName) ??
            throw new KernelException($"No '{fullTypeName}' message type is found while resolving data contracts for the '{methodName}' method.");

        var fields = this.GetDataContractFields(messageType.Fields);

        return new GrpcOperationDataContractType(fullTypeName, fields);
    }

    /// <summary>
    /// Returns data contract fields.
    /// </summary>
    /// <param name="fields">Message type fields.</param>
    /// <returns>The data contract fields.</returns>
    private List<GrpcOperationDataContractTypeFiled> GetDataContractFields(List<FieldDescriptorProto> fields)
    {
        var result = new List<GrpcOperationDataContractTypeFiled>();

        foreach (var field in fields)
        {
            var type = GetProtobufDataTypeName(field.type);

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Confirm the message type referenced by the method exists in the same .proto (and is spelled identically).
  2. Ensure the package prefix matches — `package.foo.Bar` must align with the package declaration.
  3. Include imported .proto files so their message types appear in allMessageTypes.

Example fix

// before
service S { rpc M (Missing) returns (Missing); }
// after
message Missing { string id = 1; }
service S { rpc M (Missing) returns (Missing); }
Defensive patterns

Strategy: validation

Validate before calling

// Cross-check that every message type referenced by rpc methods is defined in the .proto or its imports.

Try / catch

try { /* register */ }
catch (KernelException ex) when (ex.Message.Contains("message type is found while resolving")) {
    // a referenced message type is missing from the schema
}

Prevention

When it happens

Trigger: A service method whose input/output type name doesn't match any defined message — typo in the type name, missing message definition, or package-qualification mismatch.

Common situations: Refactoring message names in the .proto without updating method signatures; package declaration changed so the full type name differs; imported message types not included in the parsed descriptor set.

Related errors


AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13). Data as JSON: /api/errors/1de3704f39800c53. Report an issue: GitHub.